Riemann-Hilbert correspondence for non-flat connections First of all, let me warn that my knowledge of the correspondence is rather superficial, and I apologize for any technical inaccuracies below. 
Setting
Let $X$ be a smooth complex algebraic variety, and $D_X$ the sheaf of differential operators on $X$. A $D$-module on $X$ is a sheaf of $D_X$-modules.
The Riemann-Hilbert correspondence establishes an equivalence between the triangulated category of regular holonomic $D_X$-modules and that of constructible sheaves. ("Recently'' extended to the irregular case by D'Agnolo and Kashiwara (link).)
Holonomic $D_X$-modules are in particular coherent over $D_X$. Furthermore, $O_X$-coherent $D_X$-coherent $D$-modules are locally free of finite rank, that is algebraic vector bundles on $X$ with flat (or integrable) connection.
Equivalently, the Riemann-Hilbert correspondence gives an equivalence from the category of flat connections on algebraic vector bundles on $X$ with (regular) singularities to the category of local systems of finite-dimensional complex vector spaces on $X$.
Questions


*

*General: Can such a correspondence be generalized to vector bundles with not necessarily flat connections? If so, what would we expect local systems to be replaced with? If not, what are the obstacles to lifting flatness? 

*Specific: Where is the flatness/non-flatness of the connection being encoded in the correspondence on both sides? Namely, where can one exactly read flatness/non-flatness?
 A: I'm a little bit familiar with the smooth category version. Fixing a basepoint $b$, you can parallel transport the fiber from the base point to any other point $p$. The transfer is path-independent if and only if going around the loop $b \to_1 p \to_2 b$ has trivial holonomy. Now according to the Ambrose-Singer theorem if the curvature of the connection is zero, the only nontrivial holonomy can come from topologically nontrivial loops and thus you get a local system. If the curvature doesn't vanish you may get a nontrivial holonomy even along homotopically trivial loops and thus you can try attaching the restricted holonomy groups to each fiber which would capture this behaviour.  
A: I'm not sure there is a full answer to the "General" question, at least, within the $D$-module setting. I'll leave some remarks about non-flatness partially answering the question, and perhaps someone will tune in and complete this to a proper answer.

First off, to understand how one can lift flatness we have to know where and how it is being encoded on each side of the correspondence:
-on the $D$-module side it comes straight from the tangent sheaf $\Theta_X$ being a Lie subalgebra of the algebra of differential operators $D_X$. It is, thus, how $\Theta_X$ sits inside $D_X$ that determines the flatness of the underlying connection;
(Aside: We may consider deformations of the algebra $\Theta_X$ where we still preserve the Lie algebra structure, generally leading to twisted $D$-modules. These seem to correspond to connections with fixed scalar curvature (mathoverflow), which under the correspondence give constructible sheaves on a gerbe over the base (mathoverflow). $D$-module theory proper doesn't seem to be the natural ground to explore generic non-flat vector bundles and, therefore, below we will make do with the subset of $O_X$-coherent $D$-modules, i.e. plain vector bundles with flat connection.)
-on the local systems side, the understanding of flatness comes from viewing them as representations of the fundamental groupoid. The fundamental groupoid encodes the notion of paths up to homotopy, which then assembles to a connection where any curvature is washed out. So, it is homotopy invariance that kills curvature. There's still holonomy in the form of monodromy, which is discrete due to flatness. Thus, if we want to lift flatness we need a weaker notion of homotopy invariance.

Let us summarize the web of correspondences at play:


*

*vector bundles with flat connection

*local systems

*representation of the fundamental groupoid
We go from 1. to 2. via the parallel sections functor $\ker\nabla$, with flatness translating into Frobenius integrability condition on the existence of (unique local) solutions to the first-order ODEs $\ker\nabla$ given arbitrary initial data. These are finite-dimensional vector spaces. The correspondence 2. to 3. arises via standard results from covering spaces (already mentioned above; see mathoverflow). We may go directly from 1. to 3. by calculating the parallel transport of the (flat) connection, which descends to a representation of the fundamental group as result of flatness (equivalently, it is the monodromy of the solutions to $\ker\nabla$). The inverse direction goes via the associated bundle construction.
Hence, there are two places where one may explore "non-flatness": the $\ker\nabla$-functor and the parallel transport functor.
$\ker\nabla$-functor
I've partially addressed this recently here Kernel of a non-integrable connection, but let me go over it again for the sake of completeness. 
For not necessarily flat connections, $\ker\nabla$ is still a well-defined subsheaf of the sheaf of sections of the vector bundle. In particular, it is a sheaf of finite-dimensional vector spaces with the stalk-rank $\dim(\ker\nabla)_x$ bounded by the vector bundle rank. However, $\ker\nabla$ is no longer a local system if $\nabla$ is not flat. That happens if and only if
$$
x\mapsto \dim(\ker\nabla)_x
$$
is a locally constant function on $X$ (see Lemma 1.6 Conrad). Furthermore, given the stratification of $X$ by stalk-dimension
$$
X^{\leq d}:=\{x\in X | \dim(\ker\nabla)_x\leq d\}\,,
$$
we have that the restriction of $\ker\nabla$ to the subsets $X^{\leq d}-X^{\leq d-1}$ is locally constant for all $d$. Hence, cleary $\ker\nabla$ is a constructible sheaf. 
This map from vector bundles with connection to constructible sheaves is certainly not invertible. As already mentioned by @user40276 the exit-path category is relevant here. In fact, a theorem due to MacPherson says that the category of constructible sheaves on $X$ is equivalent to the category of representations of the exit-path category (see Treumann). The exit-path category encodes the notion of exit-paths again up to homotopy. Therefore, on each stratum the curvature of the connection is being killed again, and what we are able to recover is a constructible vector bundle with flat connection (see this thesis of a Block's student; and also mathoverflow). Basically, it is a flat vector bundle on each stratum.
The question remains on how to better characterize the image of $\ker\nabla$ such that we recover a correspondence. See related questions mathoverflow, math.stackexchange.
Parallel transport functor
In the smooth setting, the parallel transport of a connection can be assembled into a functor $\text{tra}$ by sending each point $x\in X$ to the vector space $E_x$, the fiber of $E$ over $x$, and a path $\gamma: x\to y$ to the parallel transport map $\text{tra}(\gamma):E_x\to E_y$. This notion is invariant under thin-homotopy, thus defining a functor from the path-groupoid of $X$ to $\text{Vect}$. Thin-homotopy is indeed the proper refinement of full homotopy to be able to accommodate (non-zero) curvature. In fact, as shown by (Schreiber & Waldorf), and also by (Berwick-Evans & Pavlov), the category of vector bundles with (not necessarily flat) connection is equivalent to the category of representations of the path-groupoid.
Remark: Notice that there's a canonical functor from the path-groupoid to the fundamental groupoid, by sending thin-homotopies to full homotopies. Therefore, a vector bundle with connection is flat if, as a representation of the path-groupoid, it factors through the fundamental groupoid.

Therefore, to close this to a circle of correspondences, as in 1.-2.-3.-1. above, and answer the question being asked we would need a sheaf-theoretic characterization of the category of representations of the path-groupoid. That is, the generalization of local systems (or constructible sheaves) for the non-flat/thin-homotopy case. I've asked about this here Category of representations of the path-groupoid.
