How should a multiple-word noun be punctuated within a compound adjective? [duplicate]

Bryan Garner, Garner's Modern American Usage (2003) has a useful discussion of this problem in his lengthy coverage of phrasal adjectives:

E. The Compound Conundrum. When the first or last element in a phrasal adjective is part of a compound noun, it too needs to be hyphenated: post-cold-war norms, not post-cold war norms. Otherwise, as in that example, cold appears more closely related to post than to war.

In your example, machine learning is the compound noun and related is the additional element in the adjective phrase, so Garner would endorse punctuating it as machine-learning-related.

The Chicago Manual of Style, fifteenth edition (2003) takes essentially the same position as Garner:

5.92 Phrasal adjectives. A phrasal adjective (also called a compound modifier) is a phrase that functions as a unit to modify a noun. A phrasal adjective follows these basic rules: ... (2) If a compound noun is an element of a phrasal adjective, the entire compound noun must be hyphenated to clarify the relationship among the words {video-game-magazine dispute} {college-football-halftime controversy}.

Words Into Type, third edition (1974) emphasizes the practical goal to be achieved by hyphenating (or not hyphenating):

Phrases used as attributive adjectives usually require hyphenation to make clear their relation to the noun they modify.

[Examples:] the how-to-study area; a life-and-death struggle

If such a phrase modifier is hyphenated at all, it should be hyphenated throughout; but no hyphen should be used between the modifier and the noun.

Wrong: low milk-and-cream yielding dam

Right: low milk-and-cream-yielding dam

Wrong: pay-as-you-go-plan

Right: pay-as-you-go plan

If there is scarcely any possibility of misreading, hyphens need not be used.

[Examples:] a story and a half house; a thirty percent increase; yellow pine timber belt

All of these (U.S.) style guides agree that when ambiguity as to what is modifying what might ensue from an unpunctuated adjective phrase, it is better to hyphenate the elements of the phrase than to leave the words open. But the goal is greater clarity—and if the hyphens don't clarify anything, they have no business being there.

Thus far, my answer has focused on the "machine-learning-related certification" example in your question. Compound modifiers that incorporate proper nouns of two words or more (such as "Mount Everest–based climbing expedition") follow a different rule in these style guides: leaving the proper name open, and connecting the compound noun to the adjective with an en-dash instead of a hyphen. I won't go back into the reference works to quote the specific guidelines from each book, but they recommend the approach I have just outlined in this paragraph.