  A regularization-independent universal formula for the energy--momentum
tensor in gauge theory in the flat spacetime can be written down by employing
the so-called Yang--Mills gradient flow. We examine a possible use of the
formula in the calculation of the axial $U(1)$ anomaly in a gravitational
field, the anomaly first obtained by Toshiei Kimura [Prog.\ Theor.\ Phys.\ {\bf
42}, 1191 (1969)]. As a general argument indicates, the formula reproduces the
correct non-local structure of the (axial $U(1)$ current)--(energy--momentum
tensor)--(energy--momentum tensor) triangle diagram in a way that is consistent
with the axial $U(1)$ anomaly. On the other hand, the formula does not
automatically reproduce the general coordinate (or translation) Ward--Takahashi
relation, requiring corrections by local counterterms. This analysis thus
illustrates the fact that the universal formula as it stands can be used only
in on-shell correlation functions, in which the energy--momentum tensor does
not coincide with other composite operators in coordinate space.
