I've wondered if Saruman had 'lab assistants' that he taught some basic explosives techniques to. Not magic per se, but things that would have been viewed as magic by the Rohirrim etc.
This is because the 'blasting fires of Orthanc' were used at Helm's Deep when Saruman was absent.
I'm hoping they were all called Igor and given to saying 'yeth marthter'
Beorn seems to use his 'magic' as a natural ability, not learned in any way.