Top of the statblock: "Aboleth Mage, 10th-Level Wizard".
And it has the relevant extra 10d4 HD.
I agree with you that we can't just add any random class levels we want, but the Aboleth Mage is in fact an Aboleth with Wizard levels and a few arbitrary-source attribute boosts.