Generalized Kubo formula for spin transport: A theory of linear response to non-Abelian fields