Elon Musk says SpaceX and Tesla are considering a merger that would combine their space, electric-vehicle and technology businesses into a company valued at about $3.5 trillion.