The Bodhisatta was once a king. One of his best assistants was sleeping with a woman in the royal harem. When this assistant heard one of his own servants was sleeping with his wife, he brought the servant to the palace and asked the Bodhisatta to suggest a punishment. The Bodhisatta replied that he also had a misbehaving servant, but because he was so useful he forgave his indiscretions. The assistant understood these words were about him and he ceased his fling. And his servant, having been exposed to the king, also stopped.
In the Lifetime of the Buddha
When the king learned one of his assistants had slept with a woman of his harem he did not say anything to them because the assistant was very useful. When the king told the Buddha about this, the Buddha told him this story so he knew he himself had once done the same thing. And when word got around to the assistant that the king knew of his affair, he ceased.
The Buddha did not identify any earlier births other than his own.