How, therefore, can the commander of a SPA change during the flight?
This has been done to death. Easy, If there are are two pilots on board both current and qualified on type and can safely reach all controls, they CAN decide who is P1 at ANY time they choose. And must log each portion of the flight they did.
Dont make it complicated.