Well, you definitely retain your class levels. If someone casts Dispel Magic on you, you'll become a level 20 Sorcerer.
However, True Polymorph does not allow you to use your class features (including the Spellcasting class feature). Compare it to the Druid's Wild Shape ability, or the Shapechange spell, both of which include this paragraph:
You retain the benefit of any features from your class, race, or other source and can use them if your new form is physically capable of doing so. However, you can't use any of your special senses, such as darkvision, unless your new form also has that sense.
Additionally, neither Wild Shape or Shapechange include the phrase "The creature is limited in the actions it can perform by the nature of its new form" that True Polymorph does. It seems clear that True Polymorph restricts you to doing things your new form is inherently capable of doing, whereas Wild Shape and Shapechange allow you to do anything you're normally capable of as long as your new form is physically able to do it.