Class is a rules mechanical concept, not an in-world concept. Now, words such as "fighter" or "wizard" might be used at times, but so could "warrior" or "mage" - it's not a class. Also, people are unique - the PCs follow class rules, but nothing says others do, and most (almost all) do not.
This is reinforced by the NPCs in the monster manual, where the same name is used but it's definitely for an in-game description and not the actual class. For example there's a Druid, who has 4th level casting but no wildshape. If "Druid" referred in-game to the class, that would not be called a druid.
I feel like labels like class are shorthand, ultimately. Their use depends on what value is gained from talking around the subject.
So I do agree with you that those (what I call) character-class-equivalents (CCEQs for short) in the MM and similar imply a lot more flexibility in the collections of features associated with classes than is represented in the PHB (and relevant supplements). Still, an MM
mage casts wizard spells. An MM
mage has no school, but a VGtM
abjurer evidently does have one: suggesting an in-world organisation or categorisation.
That makes me feel that an in-world person might guess at the kinds of things a CCEQ or PC will be capable of, based on observation of other things they are capable of along with any organisational labels they know to be applicable, e.g. they might guess that a
mage could cast
magic missile.
I assume awareness of power sources and feature groups. No doubt the language if overheard in-world would be more roundabout, but it amounts to X is a Y, so X's capabilities very well could include Z. As a DM, I don't mind players abbreviating that using class appellations, and I do likewise. It doesn't bother me if players call Mordenkainen a "wizard", for example. In my campaign he was a modified
archmage. Calling someone a wizard amounts to a prediction about what they might be capable of. It's a convenient label because the nth time I take up time at the table waffling about circles and puissance... could hold low value.
Like other posters, I feel like this knowledge would be scalable. One NPC could have a very clear knowledge of paladins and their tiers. Another might never have heard of them. I would not differentiate between casters and melee in that regard, because all classes in D&D have preternatural abilities.