This is essentially the same calculation I outlined in this other answer (though it might not be immediately obvious).$\newcommand{\ket}[1]{\lvert#1\rangle}\newcommand{\ketbra}[2]{\lvert#1\rangle\!\langle#2\rvert}$
Let us denote with $\Pi_Y$ and $\Pi_N=I-\Pi_Y$ the projectors onto the "yes space" and the "no space".
Given an initial state $\ket\psi$, the goal is getting as close to a state in $\Pi_Y$ as possible, as fast as possible.
Find a convenient representation of the states — Because $\{\Pi_Y,\Pi_N\}$ define a separation of the full space, any state can be decomposed using these operators. In particular, we can write
$$\ket\psi=\cos\theta\ket\alpha+\sin\theta\ket\beta,$$
where $\theta=\arccos(\|\Pi_Y\ket\psi\|)$, $\ket\alpha\equiv\Pi_Y\ket\psi/\cos\theta$ and $\ket\beta\equiv\Pi_N\ket\psi/\sin\theta$.
Intuitively, I'm writing $|\psi\rangle$ as a superposition of its projections onto "yes" and "no" spaces, defining $|\alpha\rangle,|\beta\rangle$ in such a way to absorb phase terms that might arise (this isn't essential, but simplifies the formalism).
Find an explicit expression for the Grover operator — The Grover iterator is defined as $G=-S_\psi S_Y$, where $S_Y$ and $S_\psi$ are reflections in state space, that is, operators which leave untouched some subspace and change the sign on everything else.
More specifically $S_Y$ flips the "yes space", while $S_\psi$ flips the direction corresponding to the initial state $\ket\psi$ (that is, it leaves the direction of the initial state untouched and flips everything else).
Mathematically, these reflections can be written as
$$S_Y\equiv I - 2\Pi_Y = \Pi_N-\Pi_Y, \qquad
S_\psi\equiv I - 2\ket\psi\!\langle\psi\rvert.$$
It follows that the Grover operator reads
$$G=(I-2\ket\psi\!\langle\psi\rvert)(2\Pi_Y-I).$$
Expanding this product we get
$$G=2\Pi_Y-I-4 \lvert\psi\rangle\!\langle\psi\rvert\Pi_Y + 2\ket\psi\!\langle\psi\rvert.$$
Expanding $\ket\psi$ in terms of $\ket\alpha$ and $\ket\beta$, and remembering the property of $\ket\alpha$ that $\Pi_Y\ket\alpha=\ket\alpha$, you can readily verify that this expression becomes, after a bit of algebra, the following (let me use here the shorthand notation $c\equiv\cos\theta$ and $s\equiv\sin\theta$):
$$G=2\Pi_Y-I+2s^2\ketbra\beta\beta-2c^2 \ketbra\alpha\alpha +2cs (\ketbra\alpha\beta-\ketbra\beta\alpha).$$
Realise the Grover operator is a rotation matrix —
The Grover iterator $G$ is clearly unitary (it's a product of reflections, which are unitary). Furthermore, in any basis containing $|\alpha\rangle,|\beta\rangle$, its components are all real. This means that $G\in\mathbf{O}(N)$, that is, $G$ is an orthogonal matrix, thus representing a rotation around some axis.
It is also straightforward, from the expression above for $G$, to see that $G$ acts trivially outside of the space spanned by $\{|\alpha\rangle,|\beta\rangle\}$. We can therefore restrict our attention to the action of $G$ on this subspace.
We then find
\begin{align}
G\ket\alpha&=-\cos(2\theta)\ket\alpha-\sin(2\theta)\ket\beta, \\
G\ket\beta&=\phantom{-}\sin(2\theta)\ket\alpha-\cos(2\theta)\ket\beta. \\
\end{align}
Collecting the corresponding amplitudes in a matrix, we conclude that the action of $G$ in the space spanned by $\ket\alpha$ and $\ket\beta$ can be represented as
$$G\doteq\begin{pmatrix}-\cos(2\theta) &\sin(2\theta)\\-\sin(2\theta) & -\cos(2\theta)\end{pmatrix}.$$
Note that this shows that the result holds in a more general scenario that the one often used when first explaining Grover's algorithm.
You can however easily reduce to the standard situation (which you also use in your post) by having $\ket\psi$ be a balanced superposition of all basis states, and $\Pi_Y$ a trace-1 projector (that is, a projector over a one-dimensional subspace).