Memory RNA
While not scientifically established (AFAIK), the concept of genetic memory goes as follows
(quoted from Wikipedia's memory RNA article):
Memory RNA is a hypothetical form of RNA that was proposed by James V. McConnell and others in the 1960s as a means of explaining how long-term memories were stored in the brain. The concept behind it was that since RNA encoded information, and since living cells could produce and modify RNA in reaction to external events, it might also be used in neurons to record stimuli.
So, your pseudo-scientific shapeshifting dragons make extensive use of RNA memory - they store their knowledge, acquired skills, autobiographic memories, muscle memory etc. in long and complex chemical chains in their blood stream - when they reproduce, some of these chains are transferred to the offspring.
You can decide which of the different types of memories are stored partially or fully on this medium, allowing for example only for skills transfer, without autobiographic memories - if something like that suits you.
This can potentially have an additional side effect - an infusion of dragon blood might give a non-dragon a portion of the dragon's memories.
The Wikipedia article has a bit more about the usage of this concept in sci-fi:
Memory RNA made some appearances in the science fiction of the time, often in the form of "skill pills" containing memory RNA that provided the consumer with new skills, or in the context of mind transfer. This concept shows up in several of Larry Niven's short stories and various episodes of The Invisible Man (2000 TV series).
A few Star Trek novels during the 1980s employed memory RNA as a plot device to allow a character to rapidly learn an alien language, in the form of an "RNA drip". The novel "Mighty Good Road" by Melissa Scott and a sequel also use it. Further, in the Star Trek: The Next Generation episode "Violations", Data claims that memory is stored in RNA sequences, analogous to his memory circuits.
The basic principle of the memory RNA was also used by comic book writer Alan Moore to explain the origin of DC Comics' character the Swamp Thing in Saga of the Swamp Thing #21. In the story, believing the creature to be dead, a scientist super-villain performs an autopsy on the Swamp Thing and discovers that it is not scientist Alec Holland turned into a plant mutant, but swamp vegetation that after digesting the mortal remains of Holland, had absorbed his mind, knowledge, memories, and skills and created a new sentient being that believed itself to be Alec Holland. The planaria experiment is used in the story to back this theory.
Afterthought: this blood-based memory can also explain how the dragons retain their memory/knowledge when metamorphing into a different organism (with a differently built brain). Shapeshifting may be the original reason this special kind of memory developed in the first place, with memory transfer to offsprings being a fortunate side effect.