  We present a general analysis for determining the optimal modulation
parameters for the modulation transfer spectroscopy scheme. The results are
universally valid and can be applied to spectroscopy of any atomic species
requiring only the knowledge of the effective linewidth $\Gamma_{eff}$. A
signal with optimized slope and amplitude is predicted for a large modulation
index $M$ and a modulation frequency comparable to the natural linewidth of the
spectroscopic transition. As a result of competing practical considerations, a
modulation index in the range of $3 \le M \le 10$ has been identified as
optimal. This parameter regime is experimentally accessible with a setup based
on an acousto-optic modulator. An optimized signal for spectroscopy of the
rubidium D2 line is presented. The signal shape and the dependence on the
modulation parameters are in very good agreement with the theoretical
description given. An experimental procedure for achieving a strong suppression
of residual amplitude modulation is presented. Based on the optimized signal,
we demonstrate long-term laser stabilization resulting in a laser linewidth of
150\,kHz (16\,s average) and a frequency stability of 18\,kHz (rms) over 15
hours.
