The world's largest car maker and the world's biggest ride-hailing company plan to team up on autonomous driving as technological changes sweep through the transportation industry.