We are approaching a level of technology which is not human-oriented but software-oriented: the crucial idea here is that the transition will be not about "jobs will be harder or require more intelligence" - its about the emergence of artificial labor pool that is inherently better, smarter and less demanding. There is no way to "retrain people" to compete with robots, there is only "retreat to segments" where automation hasn't arrived yet - a narrower subset of potential jobs(there are no magical 'new jobs' coming).
Lets take for example Joe The Programmer as someone who doesn't fear being automated.:
He is confident he can write software better than a program trained to do so, and all his life beliefs hinge on that idea.
He could do a less mentally-challenging job - but they are all taken by robots and automatons, doing it at fraction of minimum wage.
Suppose a neural-net generator emerges that can produce software from requirements and diagrams of the middle management types. At first its used only for the simplest, mind-numbing tasks or viewed as debug aid. It develops to covers creation of modular pieces of code and its code quality is superb. Now the time come and grown complex enough to create functional software by itself without human input.
The management looks at it, and decides to cut down on their software division. Jobs in the segments become fewer and fewer.
Joe The Programmer now has to retrain himself to do something the code generator can't do, or hasn't expanded to area yet. But with progress there is nothing left, the most complex software can be done with minimal bugs and without unreliable human programmers. Software proven itself much cheaper to maintain with minimal staff - even it will be eventually replaced by helper software.
Joe The Programmer is now fired. Now that there is no need for much middle management, as there is little to manage: the company shrinks and becomes more productive. At ultimate point the key personnel/directors/Chief officers are replaced by expert systems trained with their domain knowledge and the company become a purely digital entity producing income for its owners or shareholders. There is no point adding human back in the chain, as it will reduce efficiency and increase complexity(labor laws, taxes, paper trails,etc).
What is key here, is we only lack the software..the hardware is here now.
i.e. all this retraining/re-specialization of the labor market will not matter, when software will be also "re-trained"(neural nets, generic algorithms,general artificial intelligence ) much cheaper to do equivalent of a human mind-work. Now it simply a hardware problem:
At X investment a machine would outperform similar X investment for a human worker/employee, with none of the extra needs/limitations/laws regulating labor.
Obviously the result in mass poverty and breakdown of class-based society if there is no moderating factor: basic income becomes a necessity, not an option "to stabilize the economy" - without it there is no economy and no society(as even third-world countries depend on job(for a very liberal definition of a job) income existing).