Normally, the hanging leg raise is performed in the sagittal plane. You lift your legs up to target the rectus abdominis. With this side-to-side variation, you target the obliques.
Don't expect the range of motion to be as pronounced as it is with a regular hanging leg raise. This should feel like a small, yet very controlled movement.
Hang from a pull-up bar and use your obliques to lift your legs as far as you can to the side. Imagine there's a wall directly in front of and behind you and you can only move in between the walls.
Do multiple sets of 5-10 controlled reps. Do not alternate sides; do one side at a time to discourage side-to-side momentum.