  (Abridged) The existence of an extended neutral hydrogen exosphere around
small planets can be used as an evidence for the presence of water in their
lower atmosphere but, to date, such feature has not been securely detected in
rocky exoplanets. Planetary exospheres can be observed using transit
spectroscopy of the Lyman-$\alpha$ line, which is limited mainly by
interstellar medium absorption in the core of the line, and airglow
contamination from the geocorona when using low-orbit space telescopes. Our
objective is to assess the detectability of the neutral hydrogen exosphere of
an Earth-like planet transiting a nearby M dwarf using Lyman-$\alpha$
spectroscopy and provide the necessary strategies to inform future
observations. The spatial distribution in the upper atmosphere is provided by
an empirical model of the geocorona, and we assume a velocity distribution
based on radiative pressure as the main driver in shaping the exosphere. We
compute the excess absorption in the stellar Lyman-$\alpha$ line while in
transit, and use realistic estimates of the uncertainties involved in
observations to determine the observability of the signal. We found that the
signal in Lyman-$\alpha$ of the exosphere of an Earth-like exoplanet transiting
M dwarfs with radii between 0.1 and 0.6 R$_\odot$ produces an excess absorption
between 50 and 600 ppm. The Lyman-$\alpha$ flux of stars decays exponentially
with distance because of interstellar medium absorption, which is the main
observability limitation. Other limits are related to the stellar radial
velocity and instrumental setup. The excess absorption in Lyman-$\alpha$ is
observable using LUVOIR/LUMOS in M dwarfs up to a distance of $\sim$15 pc. The
analysis of noise-injected data suggests that it would be possible to detect
the exosphere of an Earth-like planet transiting TRAPPIST-1 within 20 transits.
