A mind flayer has the following requirement in order to perform its Extract Brain Action (MM, 222):
one incapacitated humanoid grappled by the mind flayer.
If a humanoid has been polymorphed (PHB, 266):
This spell transforms a creature that you can see within range into a new form…
The target’s game statistics, including mental ability scores, are replaced by the statistics of the chosen beast. It retains its alignment and personality.
If a humanoid has used the Wild Shape class feature, they (PHB, 66-7):
magically assume the shape of a beast that (they) have seen before.
Your game statistics are replaced by the statistics of the beast, but you retain your alignment, personality, and Intelligence, Wisdom, and Charisma scores.
You retain the benefit of any features from your class, race, or other source and can use them if the new form is physically capable of doing so.
In both forms, the creatures are clearly in a beast shape, but are they (or their brains) still considered “humanoid”?