Stackelberg optimization of two-level systems