Generally, a compound modifier is hyphenated if the hyphen helps the reader differentiate a compound modifier from two adjacent modifiers that modify the noun independently.
Sometimes different ways of hyphenation reflect different words (e.g. "me-gint" again, a single word hyphenated by syllables, cf. "meg-int" admonish, a compound with a verbal prefix, hyphenated by elements).