So here is my solution to the problem (which is somewhat of a generalization of the proof in Jech's Set Theory, 3rd Millennium Edition I also unified the case of limit ordinal and successor ordinal).
I will be using three simple facts:
- If $X,Y$ are Polish and $X$ perfect then there is an open set in $X\times Y$ which is universal for open sets in $Y$;
- If $G_\alpha\subseteq X\times Y$ is universal for $\Sigma^0_\alpha(Y)$ then $(X\times Y)\setminus G_\alpha$ is universal for $\Pi^0_\alpha(Y)$ - and vice versa.
- If $X\subseteq Y$ then $\Sigma^0_\alpha(X)=\{A\cap X\mid A\in\Sigma^0_\alpha(Y)\}$, as well for $\Pi^0_\alpha(X)$.
- If $f\colon X\to Y$ is continuous and $A\in\Sigma^0_\alpha(Y)$ ($A\in\Pi^0_\alpha(Y)$) then $f^{-1}[A]\in\Sigma^0_\alpha(X)$ ($f^{-1}[A]\in\Pi^0_\alpha(X)$)
Theorem: Let $X,Y$ be Polish spaces, $X$ perfect, and $\alpha<\omega_1$. There exists $G_\alpha\subseteq X\times Y$ such that:
- $G_\alpha\in\Sigma^0_\alpha(X\times Y)$,
- $\Big\{\{y\in Y\mid\langle x,y\rangle\in G_\alpha\}\mid x\in X\Big\} = \Sigma^0_\alpha(Y)$ - that is every cut of $G_\alpha$ over $X$ is a $\Sigma^0_\alpha$ subset of $Y$, and every $\Sigma^0_\alpha$ subset of $Y$ is such cut.
Proof: It is enough to show there exists a universal set based on the Baire space. $X$ is perfect so Baire embeds into it as $\Pi^0_2$ (also known as $G_\delta$) - since it is a completely metrizable subset of a metric space.
Now if $\alpha>2$ then the universal set based on Baire embeds into the same level in the hierarchy of $X$ and so the universal set retains its level in the Borel hierarchy of $X$. For $\alpha=1$ we use Fact 1 for open, and its complement for closed sets (Fact 2) and we can generate universal sets based on $X$ in a straightforward manner. If $\alpha=2$ then we use Baire to generate $\Pi^0_2$-universal set in $X$, and Fact 2 to create a $\Sigma^0_2$-universal based on $X$. [Looking back, this proof can be modified so there is no need for the Baire space and the induction could work straightforward using only the fact that a countable product of Polish spaces is Polish.]
Now to prove the specific case that $X=\omega^\omega$.
Take $\langle\alpha_n\mid n<\omega\rangle$ a non-decreasing and cofinal sequence in $\alpha$ (if $\alpha=\beta+1$ take $\alpha_n=\beta$ for all $n$). By induction we have $G_{\alpha_n}\subseteq\omega^\omega\times Y$ which is $\Sigma^0_{\alpha_n}$-universal.
Take a homeomorphism of $\omega^\omega$ with $(\omega^\omega)^\omega$, and let $x_{(n)}$ be the $n$-th coordinate of the image of $x$ under the selected homeomorphism, note that the homeomorphism extends to a homeomorphism from $\omega^\omega\times Y$ to $(\omega^\omega)^\omega\times Y$.
Define $G_\alpha = \{\langle x,y\rangle\mid \exists n\in\omega(\langle x_{(n)},y\rangle\notin G_{\alpha_n})\}$. Equivalently, take $\widehat{G_{\alpha_n}}=(\omega^\omega\times Y)\setminus G_{\alpha_n}$, which is a $\Pi^0_{\alpha_n}$-universal set, and take $G_\alpha = \{\langle x,y\rangle\mid\exists n\in\omega(\langle x_{(n)},y\rangle\in\widehat{G_{\alpha_n}})\}$
It is clear that $G_\alpha$ is the union of the continuous preimage of $\widehat{G_{\alpha_n}}$. By Fact 4 this is a union of countably many $\Pi^0_\beta$ sets, for $\beta<\alpha$ and therefore a $\Sigma^0_\alpha$ set as needed.
Suppose $x\in\omega^\omega$, the set $A=\{y\in Y\mid \langle x,y\rangle\in G_\alpha\}$ is the union $\bigcup_n\{y\in Y\mid\langle x_{(n)},y\rangle\in G_{\alpha_n}\}$, and for every $n$ the set is $\Pi^0_{\alpha_n}$, so $A$ is $\Sigma^0_\alpha(Y)$ as needed.
On the other hand, $A\in\Sigma^0_\alpha(Y)$, then $A=\bigcup_n A_n$ for $A_n\in\bigcup_{\beta<\alpha}\Pi^0_\beta$. Since $\alpha_n$ is cofinal in $\alpha$, and $\Pi^0_\gamma(Y)\subseteq\Pi^0_\xi(Y)$ we can assume without the loss of generality that $A_n\in\Pi^0_{\alpha_n}$ (otherwise reorder $A_n$ and add the empty set where needed).
We have that for every $n$ there is $x_n\in\omega^\omega$ such that $A_n=\{y\in Y\mid\langle x_n,y\rangle\in G_{\alpha_n}\}$. Take $x$ such that $x_{(n)}=x_n$, and it is clear that $A=\{y\in Y\mid\langle x,y\rangle\in G_\alpha\}$.
Therefore $G_\alpha$ is as needed.