Application of resonance perturbation theory to dynamics of magnetization in spin systems interacting with local and collective bosonic reservoirs