The president also announced a major deal with Japan as Elon Musk officially leaves his role at the White House.