The story is from this chapter and this chapter of the Shanti Parva of the Mahabharata. Bhishma heard it from his guru, Vishnu's incarnation Parashurama. (Bhishma and Parashurama later fought a battle against each other, as I discuss here.) There was once a Rishi who lived in the forest and by virtue of his Tapasya (deep meditation), he became a friend of all the animals. In particular, a dog became his constant companion. One day a leopard came, and the dog sought the Rishi's protection, so the Rishi transformed the dog into a stronger leopard. Then another day a stampeding elephant came, and the dog-turned-leopard again sought the Rishi's protection, so the Rishi transformed it into a stronger elephant. Then a lion came to eat the elephant, so the Rishi transformed it into a stronger lion.
Finally, a Sharabha came to the ashram. For those who don't know, a Sharabha is a legendary half-lion half-bird creature which kills lions. As I discuss here, Shiva is said to have turned into a Sharabha in an attempt to subdue Vishnu's incarnation Narasimha. In any case, the dog-turned-lion again sought the Rishi's protection, so the Rishi turned it into an even more powerful Sharabha. Now the dog-turned-Sharabha became so bloodthirsty that it wanted to eat the Rishi himself. The Rishi was able to sense this, so he cursed the Sharabha to turn back into the dog, and then he chased the dog out of his ashram.
Bhishma tells Yudhishthira this story, while lying down on a bed of arrows at the end of the Mahabharata war, in order to teach him to be careful in choosing which servants to give power to, because they can easily betray you:
An intelligent king should, guided by this precedent, appoint servants, each fit for the office assigned to him, and exercise proper supervision over them, having first ascertained their qualifications in respect of truthfulness and purity, sincerity, general disposition, knowledge of the scripture, conduct, birth, self-restraint, compassion, strength, energy, dignity, and forgiveness. A king should never take a minister without first having examined him. If a king gathers round him persons of low birth, he can never be happy. A person of high birth, even if persecuted without any fault by his royal master, never sets his heart, in consequence of the respectability of his blood, upon injuring his master. An individual, however, that is mean and of low birth, having obtained even great affluence from his connection with some honest man, becomes an enemy of the latter if only he is reproached in words.
And indeed, it was a bad choice of minister that ultimately led to the end of the illustrious Kuru dynasty; the last Kuru king Kshemaka, a descendant of Arjuna's great-grandson Janamejaya, was killed by his minister who took over the kingdom.