While true polymorphed into a monster, a PC has no class or level.
True Polymorph (PHB, p. 283):
The target’s game statistics, including mental ability scores, are replaced by the statistics of the new form. It retains its alignment and personality.
Class and levels are game statistics, so those go away, along with all class features, racial and background abilities, and proficiencies. A 16th-level wizard who true polymorphs themselves into a marilith becomes a six-armed snake demon with no spellcasting abilities, and is no longer a wizard. The DM might allow a true polymorphed player character to gain levels in a character class (starting at level 1), or they might not, depending on what the new form is.
Contrast with Shapechange (PHB p. 275):
Your game statistics are replaced by the statistics
of the chosen creature, though you retain your alignment and Intelligence, Wisdom, and Charisma scores. You also retain all of your skill and saving
throw proficiencies, in addition to gaining those of the creature. If the creature has the same proficiency as you and the bonus listed in its statistics is higher than yours, use the creature’s bonus in place of yours.
...
You retain the benefit of any features from your class, race, or other source and can use them, provided that your new form is physically capable of doing so. You can’t use any special senses you have (for example, darkvision) unless your new form also has that sense. You can only speak if the creature can normally speak.
This ("you retain...") is the language used to indicate exceptions to the "game statistics are replaced" effect. No such language is used in the descriptions of true polymorph or polymorph.
This wording only mentions the features obtained from class (which are a function of level). But are class and level themselves game statistics? Is a 16th-level wizard who has been subjected to a true polymorph spell still a 16th-level wizard, albeit one with no class features?
Here's what we have in the text:
Step-by-Step Characters (PHB, P.11)
Your character is a combination of game statistics, roleplaying hooks, and your imagination.
Also, the DMG has a section on NPC Statistics (p. 92), which has a subsection "Using Classes and Levels."
Considering the wording in the PHB, class and level aren't roleplaying hooks, or part of the player's imagination, so, by disjunction, they must be game statistics. And the DMG lists "class and level" as part of the things you can specify when determining an NPC's statistics. So it seems that class and level are not separate from other "game statistics". This conforms to our simple intuitions; class and level are game-system concepts, and there's no reason to think they are somehow not "game statistics" in this sense.