Skip to the 8:55 mark here for a video demonstration.
Just as with forward leg swings, leg swings across the body can warm up muscles of the swinging leg, as well as single-leg stance ability in the stands leg.
Make sure you're properly engaging the abdominal wall and keeping good posture through your warm up.
Brace the abdominal wall and keep it rigid.
It's as much for the stance leg as the swinging leg.