You need at least a single 9th level spell before you can learn formal. Once purchased formal magic can be bought like a production skill, like Create Potion and Alchemy.
And formal magic does not count in your spell tree, so 2 levels of formal are not required for your fourth 9th level spell.