The title you see in Borderlands 2 under your experience bar is determined by your current Class Mod
For example if your Maya has equipped the Legendary Siren Class Mod (pictured), her title would be "Legendary Siren". Or if your Zer0 equipped the Shadow Stalker Class Mod, your title would be "Shadow Stalker".
If you do not have a class mod equipped, your title is just your class (for example, Commando