Chern-Weil theory gives characteristic classes (e.g. Chern class, Euler class, Pontryagin) of a vector bundle in terms of polynomials in the curvature form of an arbitrary connection. There seems to be no hope in getting Stiefel-Whitney classes from this method since Chern-Weil gives cohomology classes with real coefficients while Stiefel-Whitney classes have $\mathbb Z/2$ coefficients. Further, since any vector bundle over a curve has vanishing curvature, classes obtained by Chern-Weil can't distinguish, for example, the Mobius bundle from the trivial bundle over the circle (while Stiefel-Whitney classes do).
Nonetheless, I am wondering if there is a more general or abstract framework that allows one to define the Stiefel-Whitney classes in the spirit of Chern-Weil. For example, maybe this is done through a more abstract definition of a connection/curvature.