  A millisecond pulsar having an ellipticity, that is an asymmetric mass
distribution around its spin-axis, could emit continuous gravitational waves,
which have not been detected so far. An indirect way to infer such waves is to
estimate the contribution of the waves to the spin-down rate of the pulsar. The
transitional pulsar PSR J1023+0038 is ideal and unique for this purpose,
because this is the only millisecond pulsar for which the spin-down rate has
been measured in both accreting and non-accreting states. Here we infer, from
our formalism based on the complete torque budget equations and the pulsar
magnetospheric origin of observed $\gamma$-rays in the two states, that PSR
J1023+0038 should emit gravitational waves due to a permanent ellipticity of
the pulsar. The formalism also explains some other main observational aspects
of this source in a self-consistent way. As an example, our formalism naturally
infers the accretion disc penetration into the pulsar magnetosphere, and
explains the observed X-ray pulsations in the accreting state using the
standard and well-accepted scenario. This, in turn, infers the larger pulsar
spin-down power in the accreting state, which, in our formalism, explains the
observed larger $\gamma$-ray emission in this state. Exploring wide ranges of
parameter values of PSR J1023+0038, and not assuming an additional source of
stellar ellipticity in the accreting state, we find the misaligned mass
quadrupole moment of the pulsar in the range of $(0.92-1.88)\times10^{36}$ g
cm$^2$, implying an ellipticity range of $(0.48-0.93)\times10^{-9}$.
