Intersection modulo 2 theory for infinite dimensional manifolds?
One can speak of transersality of intersections in an infinite dimensional context. If one goes beyond Hilbert manifolds (e.g. Banach, Frechet) one needs to be a bit careful with the definition of transverse, because one needs to impose splitting conditions. For a submanifold one typically demands that the tangent space $T_xX$ admits a closed complement. Then it it is not enough to demand that $T_xX +T_xY=T_xM$ at every point of intersection, but one needs that $T_xX\cap T_xY$ is closed and complemented. To be able to ignore this issue, let me assume that $Z$ is a Hilbert manifold and $X,Y\subseteq Z$ are submanifolds.
Then if $X$ is closed (as a subset of $Z$), is of finite codimension $m$, and $Y$ is compact of finite dimension $n$, and the intersection is transverse then $X\cap Y$ is a compact submanifold of dimension $n-m$. Moreover, if $f:Y\rightarrow Z$ denotes the inclusion, and $g$ is homotopic to $f$ and also transverse to $X$ than $g(Y)\cap Z$ is cobordant to $f(Y)\cap Z$. In particular, this means that the mod $2$ intersection number is well-defined in this context. If the normal bundle of $X$ is oriented, and $Y$ is also oriented, everything works with orientations as well.
A nice class of mappings are Fredholm mappings. Smale famously proved if $f:M\rightarrow N$ is a smooth Fredholm mapping of index $k$, that $f$ has regular values (without Fredholm this can be false), and that the preimage of a regular value is a manifold of dimension equal to $k$. If $f$ is a proper map, then this manifold is compact. The cobordism class of the regular value is independent of the regular value, and the proper Fredholm cobordism class. This can be used to distinguish proper Fredholm mappings. Together with Alberto Abbondandolo we upgraded this invariant to a full invariant (infinite dimensional framed cobordism classes) in the case $N$ is the Hilbert space. This is in this paper here:
MR4058178 Prelim Abbondandolo, Alberto; Rot, Thomas O.; On the homotopy classification of proper Fredholm maps into a Hilbert space. J. Reine Angew. Math. 759 (2020), 161–200. 58B15 (47A53 47H11)
We also discuss the framed cobordism classes of non-positive index in this paper. The index one case, for simply connected Hilbert manifolds, is done in our recent preprint.
https://arxiv.org/abs/2005.03936
This was supposed to be a comment but got too long.
The general result which encompasses both your examples in finite dimensions is the following: If $Y\subseteq Z$ is a submanifold of codimension $k$ and $f:X\to Z$ is a map transverse to $Y$, then $f^{-1}(Y)\subseteq X$ is a submanifold of codimension $k$.
In your second example $f:X\to Z$ is the inclusion, and so for $f^{-1}(Y)=X\cap Y$ to be a finite set you need $\dim(X)+\dim(Y)=\dim(Z)$, i.e. $X$ and $Y$ to have complementary dimensions. If the manifolds are infinite dimensional, this doesn't seem to make sense.
Your first example, where you have a map $f:X\to Z$ and regular values $y,z\in Z$, does generalize to the setting of proper Fredholm maps. MO user Thomas Rot has done some work on this - see these slides of a talk he gave at the Skye conference in 2018. In particular, if the Fredholm index $$ \dim\ker df_x - \dim\operatorname{coker} df_x $$ of each differential $df_x:TX_x\to TZ_{f(x)}$ is $k$ for all $x\in X$, then the pre-image of a regular value is a well-defined $k$-dimensional unoriented cobordism class. When $k=0$ this is an integer mod $2$.
Surely there is more to say, perhaps Thomas himself will come along and answer.