Can a True Polymorphed character gain classes?

Say, my human Wizard permanently True Polymorphs themself into a halfling. That halfling won’t have a class, so can it, say, gain Fighter levels? What about creatures that aren’t playable races, like a Beholder, or a Cat?