Negative commandment · Lo Ta’aseh #40 of 613
For a man not to wear articles appropriate for women
שלא יעדה איש עדי אישה
The verse · Devarim 22:5
לֹא־יִהְיֶה כְלִי־גֶבֶר עַל־אִשָּׁה וְלֹא־יִלְבַּשׁ גֶּבֶר שִׂמְלַת אִשָּׁה כִּי תוֹעֲבַת ה׳ אֱלֹהֶיךָ כׇּל־עֹשֵׂה אֵלֶּה
“A woman shall not wear that which pertains to a man, neither shall a man put on a woman’s garment: for all that do so are abomination to the Lord thy God.”
The Rambam’s words
For a man not to wear articles appropriate for women, as [Deuteronomy 22:5] states: "A man should not wear a woman's clothing." [This prohibition was instituted] because this is an idolatrous custom. Explicit statements to this effect are found in the texts describing their worship.
שלא יעדה איש עדי אישה, שנאמר "ולא ילבש גבר שמלת אישה" (דברים כב,ה), מפני שזה היה מנהג עובדי עבודה זרה וכן מפורש בספרי עבודתה.
Who & when
“And this prohibition is practiced in every place and at all times by males.”
Where in the Mishneh Torah
Hilchot Foreign Worship and Customs of the Nations הלכות עבודה זרה וחוקות הגויים