One of the big challenges we face as a society is managing these kinds of transitions. In 1900, the majority of Americans worked on farms. We managed that transition, but we had decades to do so. If self-driving cars eliminate all driving jobs in a single decade, the dislocation will be immense.
This is where government action will be required; this is a society-wide problem that needs a society-wide solution.