For practicing flags, stall bars are a great tool, as there are not so much rotational forces as on a pole.
When I try doing one, I approach it from the top, kicking the legs up to lower into the flag. Just getting into a solid tucked hold (without lowering) might be the first step...then playing with leg extension for one leg.
The general rule of thumb in the bodyweight and calishtenics world is to test your max hold at that level, then divide it in half and do enough sets at that hold time to accumluate roughly 60 seconds.
I actually very rarely do them. But bluejeff is spot on. Flag holds are flagging quickly when doing max holds. Just shorter bits of a manageable hold is the way to be getting used to it - keep this as practice...rather frequently when you can tolerate it, but limited attempts, low volume...build up slowly.
As in the video above I come from the top and lean into my front abs rather then the sides which is easier (for me. I like to finish my training with a set of five standing abwheels - so I have some strength at my front) than a hanging onto the side of the abs.