In their famous 1976 paper, Hirzebruch and Zagier define certain divisors $T_N$ on the Hilbert modular surface corresponding to the group $\text{SL}_2(\mathcal{O}_F)$ for $F=\mathbb{Q}(\sqrt{p})$. They then prove the generating $q$-series of the $T_N$ is modular. The definition of these cycles is given analytically, via the uniformization of the surface by the squared upper half-plane $\mathcal{H}^2$ with coordinates $z_1,z_2$. In particular, the cycle is given by the image of the locus of the equation $$ a\sqrt{p} z_1z_2+\lambda z_2 -\lambda' z_1 +b\sqrt{p}=0$$ for $a,b\in\mathbb{Z},\lambda \in \mathcal{O}_F$ and $\lambda'$ its Galois conjugate, satisfying the equation $\mathbf{N}(\lambda)+abp=N$.
I'm aware there are more algebro-geometric definitions, e.g. in some papers by Yifeng Liu, but they work in a slightly different, sometimes more general setting, and I'm unable to reconcile them or see precisely how it corresponds. So my question is: what is an interpretation of the original cycles $T_N$ of Hirzebruch-Zagier, in terms of embeddings of modular/Shimura curves via moduli of elliptic curves/abelian varieties with extra structure? A reference which spells out transparently the relation between the more algebro-geometric definitions and the formula-based ones would be especially appreciated.