Given a vector bundle with connection \((\mathcal{V}, \nabla)\) over \(\pi:X\to S\), i.e. the connections are \(\mathcal{O}_S\) linear. We can associate a de-Rham complex
\[ (\mathcal{V},\nabla) \mapsto \Omega^\bullet_{X/S}(\mathcal{V}) = \mathcal{V}\otimes_{\mathcal{O}_X}\Omega_{X/S}^\bullet \]
I think the category of flat connections on \(X/S\) can be viewed as the category of \(D_{X/S}\)-modules where \(D_{X/S} = \langle \mathcal{O}_X, \Theta_{X/S}\rangle\) is the relative \(D\)-ring, with \(\Theta_{X/S}=\ker(\pi_* : \Theta_X\to \Theta_S)\) the relative tangent sheaf, those tangent vectors that does not project to \(S\).
The two projection maps
\[ X\xrightarrow{\pi} S\xrightarrow{p_S} \mathrm{Spec}k \]
Gives pushforward functors
\[ \pi_* : {}_{D_{X/S}}\mathbf{Mod} \to {}_{\mathcal{O}_S}\mathbf{Mod} \]