Extreme Retraining

By the default rules, PCs can't retrain their class, ancestry, background, attribute modifiers, or anything else intrinsic to their character. However, you might be able to find a way to make this happen in the story, going beyond the realm of retraining and into deeper, narrative quests. Class and attribute modifiers are the simplest of these changes to justify, as they could come about solely through intense retraining. Especially at low levels, you might let a player rebuild their character as a different class, perhaps starting by retraining into a multiclass dedication for their new class and swapping into more feats from that dedication as partial progress toward the class change. Just be mindful that they aren't swapping over to switch out a class they think is great at low levels for one they think is stronger at high levels, or constantly swapping classes to chase a new play style. Retraining a class or ability modifiers should take a long time, typically months or years.

Changing an ancestry or heritage requires biohacking or magic, such as reincarnation into a new form. This might take a complex ritual, exposure to experimental biotechnology, or the intervention of a deity. For instance, you might require an ysoki who wants to be a shirren to first become trained in Shirren Lore, worship Hylax, and eventually do a great service for a shirren colony to get a divine blessing of transformation.

Retraining a background requires altering the game's story so that the events the PC thought happened didn't. That can be pretty tricky to justify! One easy scenario is that they had their memory altered or replaced with memories from another timeline and need to get it restored to reveal their “true” background—the new retrained background. They might also be revealed as a clone or parallel self from another reality.

Of course, in all these cases you could make an exception and just let the player make the change without explanation. This effectively acknowledges that you're playing a game and don't need an in-world justification to make certain retroactive changes. Or the justification could be something the player is unaware of until later, potentially tying the retraining into the larger ongoing themes of the campaign. It might be easier, or require less suspension of disbelief, to ask the group to adjust their ideas of what previously happened in the game—retconning events—than to create an in-world justification for something like an ysoki turning into a shirren via magic or a technomancer becoming a witchwarper via reality hopping.