In my Differential Geometry course, we have seen a way to calculate the Gaussian curvature $K$ given a metric expressed as the sum of two Pfaff forms $Q = ω_1^2 + ω_2^2$: we find another Pfaff form $ω_3$ (which they said is unique) that meets these equations
$$ \mathrm{d} ω_1 = ω_2 \wedge ω_3 \\ \mathrm{d} ω_2 = ω_3 \wedge ω_1 $$
Then, the Gaussian curvature $K$ is the only function such that $$ \mathrm{d} ω_3 = K ω_1 \wedge ω_2$$ or alternatively $$ K = \frac{\mathrm{d}ω_3}{ω_1\wedge ω_2} $$
My question is, where does this expression come from? I understand what is Gaussian curvature and its relationship to the geometry of a surface and first and second fundamental forms (or at least I think I understand it), but this expression is absolutely misterious to me. I've googled a lot and only found that it may be related to connections but we haven't studied topology yet.
This is a really good question.
Acknowledgement: Pretty much everything I'm about to say is lifted directly from Barrett O'Neill's "Elementary Differential Geometry."
Recall: Given an orthonormal frame field $\{E_1, E_2\}$ on a surface $M$, we define $\omega_1, \omega_2$ as their dual $1$-forms. That is, $$\begin{align*} \omega_1(E_1) & = 1, & \omega_1(E_2) & = 0 \\ \omega_2(E_1) & = 0, & \omega_2(E_2) & = 1. \\ \end{align*}$$ We can interpret $\omega_3$ (usually denoted $\omega_{12}$ or $\omega_{21}$ in the literature) as describing the rate of rotation of the frame $\{E_1, E_2\}$.
(This is somewhat analogous to how the curvature $\kappa$ of a curve in $\mathbb{R}^3$ describes how much the tangent vector $t$ is rotating towards the normal vector $n$, or how the torsion $\tau$ describes how much the normal vector $n$ is rotating towards the binormal vector $b$.)
The nice thing here is that the forms $\omega_1, \omega_2$, and $\omega_{12}$ are intrinsic to the surface: we can make sense of them completely without reference to the ambient space $\mathbb{R}^3$. Said another way, they can be defined without reference to a surface normal vector field (unlike, say, the second fundamental form or shape operator or mean curvature).
But let's take an extrinsic point of view for a moment. Suppose that $M$ lies in $\mathbb{R}^3$, so that we can talk about its shape operator $S$. Let's express the shape operator in terms of our frame field $\{E_1, E_2\}$. Doing so, we write $$S(v) = \omega_{13}(v)E_1 + \omega_{23}(v)E_2,$$ where $\omega_{13}$ and $\omega_{23}$ are two new $1$-forms, which function as the components of $S$ with respect to our frame field. Said another way, we can write the shape operator as a matrix $$S = \begin{pmatrix} \omega_{13}(E_1) & \omega_{13}(E_2) \\ \omega_{23}(E_1) & \omega_{23}(E_2) \\ \end{pmatrix}.$$
So what? Well, if we recall that the Gaussian curvature $K$ is the determinant of the shape operator, we see that
$$K = \det(S) = \omega_{13}(E_1)\omega_{23}(E_2) - \omega_{13}(E_2)\omega_{23}(E_1) = (\omega_{13} \wedge \omega_{23})(E_1, E_2),$$ and so \begin{equation} \omega_{13} \wedge \omega_{23} = K \,\omega_1 \wedge \omega_2. \tag{1} \end{equation}
Finally we get to the point: there is a very important equation, called Cartan's Second Structure Equation, which says that \begin{equation} d\omega_{12} = \omega_{13} \wedge \omega_{23}. \tag{2} \end{equation}
This is essentially saying that the ambient space, $\mathbb{R}^3$, is flat (though I won't go into why you should believe me on that). At any rate, putting (1) and (2) together gives the Gauss Equation $$d\omega_{12} = K\,\omega_1 \wedge \omega_2.$$