Barristan, talking to Dany:
As a young boy, the Prince of Dragonstone was bookish to a fault. He was reading so early that men said Queen Rhaella must have swallowed some books and a candle whilst he was in her womb. Rhaegar took no interest in the play of other children. The maesters were awed by his wits, but his father’s knights would jest sourly that Baelor the Blessed had been born again. Until one day Prince Rhaegar found something in his scrolls that changed him. No one knows what it might have been, only that the boy suddenly appeared early one morning in the yard as the knights were donning their steel. He walked up to Ser Willem Darry, the master-at-arms, and said, 'I will require a sword and armor. It seems I must be a warrior.'
Honestly I doubt it passed from every king to heir. There were too many examples of bad kings or jealousy between king and heir. A more likely explanation is that the general knowledge was written down and forgotten at some point. Rhaegar clearly learned of it on his own and took matters into his own hands. Then again perhaps that's separate from whatever the show is doing, since both GoT and HOTD have never addressed the other part ("the dragon has three heads").