Ok, firstly you need to push your weight down into your heels, this should help prevent your leg sliding back. You need to keep your entire leg in contact with his sides, rather than just grabbing with your knees.
If you still find it difficult, raise your stirrups a hole or two, that always helps.
Apart from that you seem to be leaning on his neck with your forearms rather than supporting your weight, but once you have a secure lower leg you'll be able to hold yourself instead of tipping forward as your leg slips back.
Sorry for the book :) Good luck (and I'll pretend I didn't see the missing helmet