  We study various relations governing quasi-automorphic forms associated to
discrete subgroups of ${\rm SL}(2,\mathbb{R}) $ called Hecke groups. We show
that the Eisenstein series associated to a Hecke group ${\rm H}(m)$ satisfy a
set of $m$ coupled linear differential equations, which are natural analogues
of the well-known Ramanujan identities for quasi-modular forms of ${\rm
SL}(2,\mathbb{Z})$. Each Hecke group is then associated to a (hyper-)elliptic
curve, whose coefficients are determined by an anomaly equation. For the $m=3$
and $4$ cases, the Ramanujan identities admit a natural geometric
interpretation as a Gauss-Manin connection on the parameter space of the
elliptic curve. The Ramanujan identities also allow us to associate a nonlinear
differential equation of order $ m $ to each Hecke group. These equations are
higher-order analogues of the Chazy equation, and we show that they are solved
by the quasi-automorphic Eisenstein series $E_2^{(m)}$ associated to ${\rm
H}(m) $ and its orbit under the Hecke group. We conclude by demonstrating that
these nonlinear equations possess the Painlev\'e property.
