Rift inheritance controls the switch from thin- to thick-skinned thrusting and basal décollement re-localization at the subduction-to-collision transition