Wizards of the Coast options
None of these quite match what you want, but these are what Wizards of the Coast had on offer:
Savage Species rituals
My first thought was Savage Species, since it has several rituals, many of which deal with changing creatures to other creatures, and really, it’s the only official 3.0e/3.5e publication that does. But nothing in it seems to have anything to do with animal companions. The detailing of wish-as-major-ritual could probably be used for this purpose, but the other major rituals require the subject to expend XP—which animal companions don’t really have. So unless we’re talking about wish, or the DM makes some favorable rulings on how the other major rituals can be used on animal companions, Savage Species surprisingly doesn’t help.
There are legendary animals in Monster Manual II, but like dire animals, this isn’t a template, just a series of animals all named “legendary X.” A legendary wolf is offered, but it is... extremely lackluster (it’s still Medium, for example, and doesn’t even have the feats it should have for its 14 HD—probably an artifact of the fact that MM2 is a 3e book). There is no option to get one as an animal companion, much less turn an existing wolf or dire wolf animal companion into one.
While we’re looking at Monster Manual II, though, the warbeast template deserves mentioning: that costs nothing but some time spent training, and substantially improves an animal’s combat prowess. Druids cannot turn a templated animal into an animal companion, but the books are less explicit about adding templates to existing animal companions. Ask your DM; warbeast is very, very good for its very low cost, if allowed.
Looking further, Eberron Campaign Setting details the horrid animal template, a template that can be applied to dire animals to make them even dire-er. As far as I know, this is the only published opportunity for an upgraded form of dire animal. And there are even entries allowing a druid to get one, generally causing the druid to count 3 levels lower than he otherwise would for the dire version of the animal. Furthermore, the description says that
The Gatekeepers, a militant sect of druids, created the first horrid animals to defend Khorvaire against incursions from the nightmare plane of Xoriat. The druids took various animals and magically altered them to create new animal species that breed true.
Nonetheless, the book does not mention how the Gatekeepers achieved this originally. Faiths of Eberron has more on the Gatekeepers, but not this aspect of them. So it’s not much of a stretch to allow a druid of sufficient level to just have some roleplayed ritual that causes him to lose 3 effective druid levels in order to grant the horrid template, but the books don’t actually come out and say that. So ask your DM. Or maybe don’t bother: even if it costs nothing but the effective −3 to druid level, I’m not sure it’s worth it—the template isn’t all that good.
Fantasy Flight Games options
And that’s it for WotC-published options, so far as I can tell.
However, searching online suggested that Fantasy Flight Games’s Legends & Lairs: Mastercraft Anthology has several “druid rituals.” As I do not own this book, however, I cannot confirm that it’s there (much less that it’s the one you’re thinking of). And HeyICanChan stated in a comment that the book does not have this option for animal companions. However, he points out that it is an incomplete collection of excerpts from other Fantasy Flight Games publications—the original source of these rituals, Spells & Spellcraft, may have it.
Default option of just leaving the animal alone
Also, bear in mind that you don’t necessarily need to “upgrade” your animal companion. A wolf is a 1st-level animal companion, while a dire wolf is a 7th-level companion—meaning you are treated as a druid of your level minus 6 for the purposes of its animal companion benefits. That means the wolf gets 4 bonus HD, +4 natural armor bonus to AC, +2 to Strength and +2 to Dexterity, and 3 more bonus tricks for being an animal companion versus what the dire wolf gets for being an animal companion. The wolf also gets devotion and evasion, while the dire wolf only gets link and share spells.
Since the dire wolf has 6 HD to the wolf’s 2, the +4 HD bonus for the wolf-as-animal-companion matches that perfectly.
The wolf also has substantially higher natural armor (6 to the dire wolf’s 3).
On the other hand, the dire wolf has massively higher Strength (25 to the wolf’s 15), so that goes to the dire wolf.
The wolf has higher Dexterity (17 to 15), while the dire wolf has higher Constitution (again 17 to 15), which probably slightly favors the dire wolf.
The dire wolf is also Large—which, since the dire wolf is a long creature, doesn’t come with reach and so isn’t nearly as much of a benefit as it ordinarily would be, and the impossibility of getting the dire wolf into some spaces in a dungeon could be a serious drawback.
And again, the wolf has evasion and devotion, while the dire wolf does not.
Finally, the dire wolf comes with Alertness and Run as its 3rd-HD and 6th-HD feats, while the wolf gains its 3rd HD and 6th HD in the druid’s care. While the common houserule allowing druids to pick their companions’ feats is a houserule, and a potentially-imbalancing one, even in a strict enforcement of the rules, the druid likely has some influence over the feats that the wolf gains. Beating Alertness and Run would not be difficult, as those are some of the worst feats in the game.
So it’s not necessarily true that the dire wolf is an upgrade over the wolf. The large increase in Strength is by far the biggest factor in the dire wolf’s favor, and that is certainly a big deal, but the wolf will fit more places, has better defenses, and can be customized more, and there is ample opportunity to best the dire wolf’s feat choices.