Note: Talk to your DM first, as this is firmly in the DM's discretion territory, as they control monster advancement.
Assuming you've already worked out how it's going to be run (a friendly NPC that adventures with you or some such), there are rules under Monster Advancement for adding racial hit die to the monster; this is basically the equivalent of adding another level of "Shadow Mastiff" instead of taking a class level. I'd figure, assuming it comes with you on your adventures, treat it like a party member: whenever you level, give it another hit die.
It also might qualify to take actual class levels; the int is a bit low, but not Animal-level intelligence, so you might be able to convince your GM to allow a class level or two in, say, Fighter or Barbarian.
You'll want to look at monster feats for feat options as he goes up in level; Improved Natural Attack and Ability Focus particularly jump out at me as applicable.