Lattice energy–momentum tensor from the Yang–Mills gradient flow—inclusion of fermion fields