The issue maybe neurological, which can definitely cause temperament changes and a vet will not be able to identify this. Or else, the issue is definitely a temperament problem.
You should not be taking this dog anywhere in public until you figure out what is happening through professional assessments. First off doing so risks terrifying the dog further and making the problem even worse (socialising would be a way of addressing minor shyness but not aggression) or alternatively, running the risk that she will bite and if she bites, you will probably have no option if a complaint is made but to put her down.
Either way, this is the type of dog I would consider an urgent case for assessment on both fronts as this is not normal behaviour -- believe me, I have dealt with dozens of dogs and work closely with professional trainers and if we had a dog behaving like this the options would be to address th situation very urgently if possible or consider having to put down the dog. It would not be considered rehomeable.
I know this will upset you, but you really need to understand how very, very serious a problem it is if a puppy that was at one point normal and friendly is now (at such a young age!) so reactive that someone simply trying to pet it could cause the dog to growl, bite and snap. This isn't just a shy or fearful puppy; there is something much more serious going on. Normally I only see that behaviour in dogs that have been placed in extreme situations or have some medical problem, often, neurological. I have only ever had two rescue dogs that snapped and one was a badly treated puppy farm dog and the other had been attacked, hot by a car, and mistreated by the owner. So it does take a serious trigger for this type of behaviour and you need to find out whether it is medical or temperament to addrss it or you are putting people and your cavalier at risk.
Please ask your vet for a referral for a neurological assessment and make sure it is with a neurologist familiar with cavalier breed health issues, especially PSOM, hydrocephalus and syringomyelia; any of these could cause the pain that might make a dog react defensively if people are reaching for its head. If that shows nothing, then please get in an APDT trainer to do a proper assessment of behaviour and temperament so you can begin to work to resolve this situation. You could get the behaviouralist in before you see a medical specialist as well, as they can often assess whether they think the problem has a medical cause or element.
Let us know what happens; I know you would not want your puppy to be suffering unecessarily if that might be the case, nor to continue in such a state of mental unhappiness that she is feeling she needs to snap and try to bite people. There is some cause for this and if you can find it then you will be able to address it and enjoy your cavalier fully. :flwr: If there is either a behaviour or medical problem you also should report this back to the breeder.