I've always used the following guidelines for determining if a foul was flagrant. If the fouling player displayed an intent to injure or showed an utter disregard for the safety of the player he fouled, then it's flagrant.
I know these determinations are still subjective, but I think that the more experience you have, the more qualified you will be to make a decision on whether or not the foul met those guidelines based on all the play you've seen over the years and the context of that particular foul.
As the saying goes, there's no substitute for experience. At least, that's what the sexy lady down on the corner tells me.