Suppose that $X$ is a connected smooth manifold and $\Gamma$ is a group acting smoothly, freely, properly and discretely on $X$, so that $Y=X/\Gamma$ is another smooth manifold endowed with a covering map $\pi:X\rightarrow Y$.
Suppose that $G$ is a Lie group and that $\rho:\Gamma \rightarrow G$ is a group homomorphism. Then we can consider the quotient $E_\rho =(X\times G)/\Gamma$, where the action of $\Gamma$ on $G$ is given by composing $\rho$ with the adjoint action of $G$ on itself. $E_\rho$ is naturally a principal $G$-bundle over $Y$.
My question is if there exists a condition for a principal $G$-bundle $E$ on $Y$ to be isomorphic to an $E_\rho$, for some homomorphism $\rho:\Gamma \rightarrow G$.
This can be interpreted as a "relative" notion of a flat connection since, if $X$ is the universal covering space of $Y$ and $\Gamma=\pi_1(Y)$, then the condition for $E$ to be of the form $E_\rho$ is that $E$ admits a flat connection.
Moreover, the same question can be extended to the holomorphic category. For example, we can take $X$ a Riemann surface and $G=U(n)$. In that situation, if $X$ is the hyperbolic plane and $Y$ is a compact Riemann surface of genus $\geq 2$, the condition for a holomorphic Hermitian vector bundle $E$ to be of the form $E_\rho$ is that it is stable of degree $0$ (this is the Theorem of Narasimhan-Seshadri).