In a mechanics and lore perspective is this reasonable customized dragon mechanics [duplicate]

I am working on the first main antagonist for my campaign a DnD 5th edition

This will be a green or blue dragon who has the ability to shape change into a human and is a magic user.

The dragon will be attempting to gather magical knowledge, spell books, arcane items etc therefore gathering strength and becoming harder for the party to combat as the campaign progresses. Initially appearing as an ally.

My question is that I know there is an arcane dragon archetype in the monster manual but these dragons seem to have inherent magic much like a sorceror as opposed to learnt. I am looking for my dragon to have some inherent magical ability strengthened by utilizing spells more like a wizard, having an ever growing list of available spells that grows as it gains more knowledge but needing to prepare a set amount each day based on its development.

In terms of either Current or historic DnD lore and mechanics are there examples of dragons learning spells in this way, gathering a magical Arsenal in the same way as a wizard would and growing in terms of magical ability over time by learning new knowledge? Am happy if the lore or mechanics ideas come from older editions of DnD that I can tweak to fit in with 5th edition.

I am specifically looking to see if there is any precedent I can work from to try and make this more balanced as the campaign progresses.