My husband and I separated in May though divorce proceedings are not through yet, so I am currently still the holder of a UK Spouse Visa. I would like to go stay with friends in Germany for a few months - not work there, just have a prolonged sort of holiday which I have enough savings to afford. Would it be legal for me to stay in Germany for longer than three months on the basis of my UK visa?
No, it would not be legal. UK is not part of Schengen area, you cannot cross the border of any Schengen country on basis of your UK visa.
See also here Schengen Visa Requirements for UK spouse.