I think the answer to the simple 'Could this evolution take place?' question is a yes, if for no other reason than that our knowledge of evolution is still far to limited to say 'No, it could not happen' (assuming, of course, that Yeerk physiology is possible, and it may be interesting to further discuss exactly how it could be plausible). I think this conversion has finally reached the most likely explanation for answering how it could happen. The problem that often hangs people up when thinking about evolution was present in this discussion from the beginning:
In order for anything to evolve a particular way, the selected traits need to simply be beneficial to the organism's rate of reproduction.
This is only true-ish. If a trait is beneficial to surviving long enough to reproduce, then the trait will become more common in further generations; it's what puts the 'selection' in "Natural selection.' But what needs to be accounted for in the long term is that, though a trait will become common faster (in terms of generations) through positive selection, genetic drift allows a trait to spread over time simply due to a lack of negative selection. In other words, for a trait to become common it doesn't need to be beneficial, it just needs to not be detrimental. For example:
Red-headedness is not beneficial to survival or reproduction among humans. If it ever was, it was only in a limited geographical region for a limited period of evolutionary time. The fact that it still exists today isn't because it is beneficial, but just because it isn't detrimental. But, if some catastrophe occurs on that destroys civilization and technology as we know it and shifts the climate to a 'late ice age, far north' climate worldwide; to the point that a red head's ability to produce vitamin D is not only beneficial but almost necessary to survive, then within a few generations the recessive genes that give red headedness may be the only ones to survive before we can rebuilt the nutritional and medical technology to keep people alive without it.
This isn't the perfect comparison, because with the Yeerks we aren't discussing a trait that provides catastrophe insurance against a backwards step for our species, but traits that allow a forward step: intelligence, infestation and host-control.
It isn't necessary for them to infest for a beneficial reason at first, the benefit can come later down the evolutionary time-line. Though Ferahgo initially supposed that the Yeerks would only evolve the infestation ability to infest a predator, whereupon they would only die when they had to leave said predator, she sees now that this doesn't necessarily need to be the case. There are plenty of examples of endosymbiosis on Earth and few, if any, infested to escape the being they infested itself. Anyways, having already evolved all the boneless, sluggy-squishy flexibility, some Yeerks may have gained some last needed trait (maybe the pain-numbing ability) and infested hosts (I.E. Gedds) for brief periods of time simply because they could, not to escape the Gedds as predators. It would have sped things up, evolutionarily speaking, if they were already intelligent enough to use this ability defensively to avoid other predators, but high level intelligence is not necessary at this point. However, a gradual increase in both intelligence and the ability to use their palps for much more specialized electric impulses to control the host (rather than simply using them for magnetic-location) would have to come next: The more sensitive electric control to control the hosts more adeptly over time and the gradually increasing intelligence to guide the host toward better survival than the host would achieve on its own.
Incidentally, since the Gedds and Yeerks evolved symbiotically then being more docile and remaining fairly unintelligent is likely a result form of positive selection on the Gedds' part, counter-intuitive though it may seem. Individual Gedds being somewhat more intelligent than the average Gedd and more defiant by nature could consistently run themselves into danger of other predators and remove itself from the gene pool while a docile and dumb Gedd is kept alive by its Controller.
In The Andalite Chronicles it is clearly stated near the beginning that the Andalites believe that the Yeerks and Gedds evolved symbiotically, however to be more clear for this discussion, I will bring in more precise terminology: Symbiotic is used in the Animorphs books in its most strict sense, where it means that both species are benefiting from the relationship; the books use it to differentiate this relationship from a parasitic one, where one benefits while the other is harmed. However, only some biologists use this strict definition, and it is less useful for discussion purposes. A better use of the term 'symbiotic' is the more general definition (which also happens to be more generally accepted) which only implies that the species coexist and interact in a long-term sense. Then the term 'symbiotic' can be divided into the sub-categories of mutualism, commensalism, and parasitism. Mutualism specifically describes the stricter interpretation of 'symbiotic' that was meant to be communicated when TAC says that the Yeerk/Gedd relationship is 'symbiotic' rather than parasitic. You could say that these two species evolved mutualistically in nature, benefiting each other in the previously described manner, but that the Yeerks, though capable of being biologically mutualistic, then choose to become socially parasitic.
At this point, Ferahgo, as you point out it is illogical to view the Gedd infestation as 'evil.' It was a natural biological process that benefited both species. The Andalites even were concluding it to be as such at the beginning of TAC. It is probably only the 'present' (in the Animorphs series) Andalites' very strong, self-righteous feeling that all Yeerk actions are completely evil that causes them to lump this initial infestation in with the rest of the Yeerks' actions as a growing evil empire.