Killing fields for Yang-Mills Physicists frequently talk about symmetries of a theory, and them being generated by Killing vectors. While this is clear to me in the context of gravity, where a Killing field $\xi$ is defined by $\mathcal{L}_\xi g = 0$, I am confused by the concept in the context of Yang-Mills. Below are my thoughts about the matter, please do correct any wrong statements.
I understand that there are similarities between gravity and Yang-Mills: the Yang-Mills curvature $F_{\mu \nu} = [D_\mu, D_\nu]$ is a bit like the Riemann curvature $R_{\cdot \cdot cd} = [\nabla_c, \nabla_d]$ of a Lorentzian manifold, where $D$ and $\nabla$ denote the respective covariant derivatives, even though in Yang-Mills everything is happening on representations of a principal $G$-bundle, while in gravity on the tangent bundle. This is why gravity is not a gauge theory.
So what is a Killing vector in a Yang-Mills theory? By example of gravity, one could imagine writing down the Killing equation $$ \nabla_a \nabla_b \xi^c = R^c_{\phantom{c}dab} \xi^d, $$ and attempting to transfer to this to the context of Yang-Mills by putting $\nabla \to D$, $R \to F$. But this feels wrong, at least at first sight, since the indices on $R$ are all on equal footing, whereas the indices on $F$ are of two different types, the 2-form indices, and the Lie algebra indices. I guess this comes back to the fact that in gravity we have a metric that we can use to raise and lower indices, but do not in Yang-Mills, or at least the connection $D$ is not the Levi-Civita connection of a metric (is it?). 
Apparently one can think of Killing vectors in Yang-Mills as covariantly constant $\mathfrak{g}$-valued vector fields $\xi$, $D \xi=0$. Where does this definition (if it is a definition) come from? And how does it relate to the usual definition $\mathcal{L}_\xi g =0$? 
 A: An infinitesimal diffeomorphism, generated by $\xi^a$, acts on the metric as $g_{ab} \mapsto g_{ab} + 2 \nabla_{(a} \xi_{b)}$. The last term is zero precisely when $\nabla_{(a} \xi_{b)} = 0$, that is, when $\xi^a$ is a Killing vector.
An infinitesimal gauge transformation on a principal bundle, generated by a $\mathfrak{g}$-valued scalar $\xi$, acts on a connection on the principle bundle as $A_a \mapsto A_a + D_a \xi$. The last term is zero precisely when $D_a \xi = 0$. So, by analogy, a covariantly constant $\mathfrak{g}$-valued scalar may as well be considered as the Yang-Mills analog of a Killing vector in General Relativity. This analogy may be the source of the definition you mentioned at the bottom of your question.
To extend the analogy further, recall how a conservation law arises from the existence of a Killing vector and a conserved stress-energy tensor:
$$
  \nabla_a (\xi_b T^{ab}) - \xi_b \nabla_a T^{ab} = (\nabla_{(a} \xi_{b)}) T^{ab} = 0 .
$$
This means that $Q^a = \xi_b T^{ab}$ is a conserved current whenever $\nabla_a T^{ab} = 0$, which is precisely the integrability condition on the stress-energy tensor to be compatible with the Bianchi identity of the Einstein equations $R_{ab} - \frac{1}{2} R g_{ab} = T_{ab}$ in the presence of matter.
Now, for Yang-Mills theory, the existence of the Killing vector and a conserved conserved charge current also gives rise to a conservation law:
$$
  \nabla_a \langle \xi, J^a \rangle - \langle \xi, D_a J^a \rangle
  = \langle D_a \xi, J^a \rangle = 0 ,
$$
where $\langle -,-\rangle$ is the invariant inner product on the Lie algebra (which by coincidence also carries Killing's name). This means that $Q^a = \langle \xi , J^a \rangle$ is a conserved current whenever $D_a J^a = 0$, which is precisely the integrability condition for the Bianchi identity of the Yang-Mills equations $D^b F_{ab} = J_a$ in the presence of charged sources.
