Many-body theory of phonon-induced spin relaxation and decoherence