...which works out to roughly 3-7 million people. Unless you want to pay them UBI, you're going to have to help them find and transition to other categories of jobs.
I used to drive a taxi. Now I write code. I paid for my own training. I'd expect to find that self-help is the most usual way to transition into other jobs.
The reality is, this is just not a functional pathway for the majority of people. So it’s not a solution
It might be possible for some minority that has a particular penchant for this type of work, but neither the jobs nor the training exist at such scale that would be able to absorb the entirety of the driver workforce into the “write software for automated driving“ job.