Here is a topological construction of such a class, in singular cohomology with rational coefficients. Let $M$ be an $S^1$-space. Then there is the Borel construction $M // S^1 := ES^1 \times_{S^1} M$. It comes with a map $f$ to $BS^1= CP^{\infty}$ which is a fibre bundle with fibre $M$. Moreover, there is a map $q: M//S^1 \to M/S^1=Q$. As a warm-up, let me give an alternative construction of the Euler class in the free case, i.e. for principal bundles. In that case, $q$ is a homotopy equivalence. Now put $e:= (q^{\ast})^{-1} f^{\ast} (z) \in H^2 (Q)$, where $z \in H^2 (BS^1)$ is the Euler class of the universal bundle. Then $e$ is the Euler class of the bundle $M \to Q$. To prove this, use universality to reduce to the case of $S^1$ acting on $ES^1$. In that case, both $q$ and $f$ are homotopy equivalences. There is a sign issue here, but allow me ignore it. Your question was of course about nonfree actions. The step that fails is that $q$ is an isomorphism in integral cohomology, because it is a homotopy equivalence. However, if the action is locally free (and everything else is nice), then $q$ is still a rational cohomology isomorphism. This can be seen by several methods; one method is similar to the argument I sketched in my answer to this question https://mathoverflow.net/questions/51993/euler-characteristic-of-orbifolds/52003#52003. The idea is that the fibre of $q$ over a point of $M/S^1$ with stabilizer group $G$ is $BG$, which has the rational cohomology of a point. The niceness of the action is needed to promote this observation to small open sets, i.e. to find a cover of $Q$ by open sets $U$ such that $q^{-1}(U) \to U$ is a rational isomorphism. Then apply Mayer-Vietoris to globalize. Once $q^{\ast}$ is shown to be an isomorphism with rational coefficients, it can be inverted and you can apply the construction from the first part of the answer. Naturality is clear.