Why is a single function sufficient to specify a canonical transformation?

Spivak argues at page 577 in his book Physics for Mathematicians:

What are the $$2n$$ relations he is talking about?

In the very next line after OP's quote Spivak is considering the 1-form $$\vartheta~:=~\sum_{i=1}^n p_i \mathrm{d}q^i - \sum_{i=1}^n P_i \mathrm{d}Q^i~\in~\Gamma(T^{\ast}M)$$ in the cotangent bundle of the $$2n$$-dimensional phase space. He is effectively referring to the $$2n$$ component functions of the 1-form $$\vartheta$$. The fact that $$\vartheta$$ is closed $$\mathrm{d}\vartheta=0$$ means that it is locally exact $$\vartheta=\mathrm{d}{\cal S}$$ and specified by a single generating function $${\cal S}$$, cf. the Poincare Lemma.