The original reference for this fact is the paper Yang-Mills Equations over Riemann Surfaces by Atiyah and Bott.
The idea is as follows. Let $P \longrightarrow \Sigma$ be a principal $G$-bundle over a Riemann surface and let $\mathcal{A}$ denote the space of connections on $P$. For a connection $A \in \mathcal{A}$, we define
$$\omega_A : T_A \mathcal{A} \times T_A \mathcal{A} \longrightarrow \Bbb R,$$
$$\omega_A(\alpha, \beta) = \int_\Sigma \langle \alpha \wedge \beta \rangle.$$
Here we have identified $T_A \mathcal{A}$ with $\Omega_\Sigma^1(\mathrm{Ad}(P))$ since $\mathcal{A}$ is an affine space modeled on $\Omega_\Sigma^1(\mathrm{Ad}(P))$. $\langle \alpha \wedge \beta \rangle$ is the composition
$$\Omega_\Sigma^1(\mathrm{Ad}(P)) \times \Omega_\Sigma^1(\mathrm{Ad}(P)) \xrightarrow{~\wedge~} \Omega_\Sigma^2(\mathrm{Ad}(P)) \xrightarrow{~\langle \cdot, \cdot \rangle ~} \Omega_\Sigma^2,$$
where $\langle \cdot, \cdot \rangle$ is an $\mathrm{Ad}$-invariant inner product on the Lie algebra $\mathfrak{g}$. Now we have the following.
Theorem. $\omega$ is a symplectic form on $\mathcal{A}$, and the action of the group of gauge transformations $\mathcal{G}$ on $\mathcal{A}$ is Hamiltonian with respect to this symplectic structure and has moment map $\mu(A) = -F_A$.
Here we consider the curvature map
$$F: \mathcal{A} \longrightarrow \Omega_\Sigma^2(\mathrm{Ad}(P))$$
as a map
$$F: \mathcal{A} \longrightarrow \mathrm{Lie}(\mathcal{G})^\ast$$
via the identification
$$\Omega_\Sigma^2(\mathrm{Ad}(P)) = \Omega_\Sigma^0(\mathrm{Ad}(P))^0 \cong \mathrm{Lie}(\mathcal{G})^\ast.$$
When we have a moment map, we can form the Marsden-Weinstein quotient
$$\mathcal{A} /\!\!/ \mathcal{G} = \mu^{-1}(0)/\mathcal{G},$$
which is a stratified symplectic space (a symplectic orbifold if $0$ is a regular value of $\mu$, and a symplectic manifold if $0$ is a regular value of $\mu$ and the action of $\mathcal{G}$ is free). Since $\mu$ is minus the curvature, we see that $\mu^{-1}(0) = \mathcal{A}^\flat$, the space of flat connections on $P$. Therefore
$$\mathcal{A} /\!\!/ \mathcal{G} = \mathcal{M}^\flat,$$
where $\mathcal{M}^\flat$ denotes the moduli space of flat connections on $P$.
There are some caveats here. The usual Marsden-Weinstein quotient is defined for finite-dimensional symplectic manifolds with a Hamiltonian action; here $\mathcal{A}$ is infinite-dimensional. Nevertheless, one can show that the formal process above works and $\mathcal{M}^\flat$ is a finite-dimensional.
As for the definition of symplectic orbifold, recall that an orbifold $\mathcal{O}$ has an orbifold atlas $\{(U_i, \tilde{U}_i, \phi_i, \Gamma_i)\}$, where $U_i \subset \mathcal{O}$ is open, $\tilde{U}_i \subset \Bbb R^n$ is open and connected, $\phi_i: U_i \longrightarrow \tilde{U}_i$ is a continuous map, and $\Gamma_i$ is a finite group of diffeomorphisms of $\tilde{U}_i$. A symplectic form on $\mathcal{O}$ is specified in terms of the orbifold atlas by a family of symplectic forms $\{\omega_i\}$, where $\omega_i$ is a symplectic form on $\tilde{U}_i \subset \Bbb R^n$ that is invariant under the action of $\Gamma_i$. We require the following compatibility condition between the $\omega_i$. Recall that the overlap condition for an orbifold goes as follows: if $x \in \tilde{U}_i$ and $y \in \tilde{U}_j$ are such that $\phi_i(x) = \phi_j(y)$, then there is a neighborhood $V_x$ of $x$ and $V_y$ of $y$ and a diffeomorphism
$$\psi: V_x \longrightarrow V_y$$
such that
$$\phi_i(z) = \phi_j(\psi(z)) \text{ for all } z \in V_x.$$
Then our compatibility condition is that
$$\omega_i = \psi^\ast \omega_j.$$