Sex reversal triggers the rapid transition from genetic to temperature-dependent sex