Primary and secondary effects: the transition to upper secondary school in Germany