There are no options in any of the core D&D 5e books which allow "retraining" a class using any definition of "retraining" that I can think of.
The only options for training of any sort I see at all are:
The PHB offers rules for multiclassing (p163) but this isn't so much "retraining" as it is training in a different field entirely.
The PHB (p187) presents training in a tool or language as a possible downtime activity. It says, "Your DM might allow additional training options." It takes about as long as a public school year in the US to complete one training option.
The DMG (p131) presents optional rules for training to gain levels. That is to say, with these optional rules you must spend gold when you reach the required XP value to gain a level. This training lasts about 2 days per level.
The DMG (p231) also presents rules for granting training as an "alternative reward." That means this option is presented as an alternative to magic items, so you're not going to be able to just go out and do it. You can spend the same amount of downtime that the PHB requires for training to learn a new skill, gain a feat, or gain inspiration daily for about a week. You'd have to ask someone else how 7-10 days of inspiration compares to a permanent skill or feat, let alone would be worth the 9 months of investment to get it.
However, keep in mind this is 5e, not 3e, and the game takes great pains to remind readers that the DM can use whatever options they want in their game, including those they devise themself or adopt from other games.