Micromechanics of twin nucleation and growth in magnesium alloys