Hero level ups and class level ups are separate (since you spend souls on class level ups)
Hero level ups aren’t random, but they’re not every level after the very early levels. I can’t remember exactly when the upgrades come, but every 10-50 levels (becoming less and less common as you get higher levels.