Buying an Animal
Animals in the Animal and Animal Gear section under the Equipment header on the d20PFSRD site often link directly to their Bestiary entries. The mastodon doesn't, but the horse or pony above it and the monkey below it do. (And, no, I've no idea why the mastodon's abandoned that way.) But it is the game's way of implying those are the statistics that are used when an animal's found, liberated, manufactured, or purchased.
A more extensive list of purchasable creatures is hidden in the description of the skill Ride, and all of those creatures link to their bestiary entries, including creatures that are probably, even in high fantasy games, rarely ridden (e.g. dodos, porcupines).
The DM, of course, can rules that individual animals are special, having better statistics (like the elite array) or other abilities depending on how the DM's advanced the creature.
Only eligible classes possess creatures that gain the bonuses from being animal companions, familiars, special mounts, and the like. Normal folks just buy a capybara or a mastodon or whatever and replace the creature with something more substantial if the previous one's no longer meeting their needs.
"Yeah, But What about Abnormal Folks?"
Adventurers have more options for upgrading a purchased animal. The skill Handle Animal lets an owner train an animal to obey commands and is usually the first step in upgrading, but the right gear and spells especially can turn your otherwise normal animal into a utility belt or engine of destruction.
Ignoring horseshoes and other animal-specific items, the following magic items are useful for improving a mundane animal:
- The bridle of tricks eliminates the need for all that training nonsense, and is probably better than the talisman of beast training.
- The burrower's bridle is specific in its use, but makes everything easier.
- The war saddle grants the animal the general purpose combat training as per the skill Handble Animal; all you have to do is get the saddle on the creature.
- The collar of the true companion grants an animal the ability to understand one language; take it off the animal every once in a while if you don't want to lose your 10,000 gp investment.
Special mention must be made of the helm of the mammoth lord, which is just awesome.
Some spells for making mundane animals more useful include...
- The 2nd-level Drd spell wartrain mount gives the creature the combat training general purpose as per the Handle Animal skill.
- The 2nd-level Sor/Wiz spell carry companion turns any helpful animal--not just an animal companion--into an itty-bitty statue for later use; duration's permanent until you turn it off.
- The 3rd-level Sor/Wiz spell anthropomorphic animal gives the animal hands and a language temporarily. It can be made permanent.
- The 4th-level Drd spell atavism gives the animal the simple template advanced.
- The 5th-level Sor/Wiz spell animal growth increases the animal's size category by 1.
- The 5th-level Drd spell awaken instantaneously grants the animal sentience therefore letting it take class levels.
This list ignores the myriad of spells that improve creatures' natural attacks--of which there are, like, a lot.