Background
I am reading through Guiellman and Pollack's Differential Topology. Ultimately I would like to understand the Euler characteristic. On page 116, they define the Euler characteristic of a compact oriented manifold $Y$ as the oriented self-intersection number of the diagonal $\Delta$ in $Y\times Y$. This definition is based on the definition of oriented intersection number of a pair of oriented submanifolds $X\subset Y$, $Z\subset Y$. When $X$ is transversal to $Z$ (and we have dimensional complementarity so that $Y=X\oplus Z$), I understand the concept of the oriented intersection number: At each intersection point of $X,Y$, just concatenate an oriented basis of $X$ with an oriented basis of $Z$ and see if you get an oriented basis of $Y$. If you do, then the local intersection number at that point is positive, otherwise it's negative. Then add up the local intersection numbers from each point of intersection. (Note: if you are familiar with the intersection number $I(f,Z)$ as defined for a function $f$ mapping into $Y$ instead of $I(X,Z)$ for a submanifold $X$, the latter notion can be derived from the former by setting $f$ to be the inclusion map $X\hookrightarrow Y$.)
Main Question
Where I am struggling to understand is when $X$ is not transversal to $Y$ (and I think this will basically always be the case when $Z=X$ as in the Euler characteristic definition). I gather that the thing to do is to slightly deform $X$ so it becomes transversal to $Z$ and then look at the intersection number of the deformed version of $X$ with $Z$ as defined above. But we would need to know that the resulting number doesn't depend on how we deform $X$ (within some neighborhood). This is where I am confused.
It may be useful to consider an example where $X=Z$ is the x-axis in $\mathbb{R^2}$ such that the positive direction (i.e. moving from left to right) is considered positively orientated. It would appear to me that the intersection number we get after deforming $X$ (leaving $Z$ alone) would depend on whether we rotate $X$ clockwise or counterclockwise. If clockwise, I think we would get a positively orientated basis for $\mathbb{R^2}$ (so an intersection number of 1) and if counterclockwise we would get a negatively oriented basis of $\mathbb{R^2}$ (so an intersection number of -1). I think there is some mistake in my understanding here? Note that I am thinking of the tangent space of $X$ as the first element of the basis and of the tangent space of $Z$ as the second element of the basis (of $\mathbb{R^2}$).
Possibly relevant: I have read through the proof that the intersection number (also apparently called degree) is homotopy invariant (from Guilleman and Pollack and from Milnor) and I think I understand this proof (which uses the classication of 1-manifolds) but I don't see how the non-transversal case is accounted for.
As a secondary question, I am also not sure how to define the oriented intersection number when $X$ is transveral to $Z$ but their tangent spaces overlap as in $\mathbb{R^3}$. A third question is how to define oriented intersection number when $X$ is not transveral to $Z$ but where their tangent spaces do not overlap as with two perpendicular lines intersecting at a point in $\mathbb{R^3}$.
Note: I have not had the time to properly work through Guilleman and Pollack line-by-line from the beginning. I have skipped over several parts so it is possible that I have missed some important concept that is typically presumed when presenting this material.
Yes, you need to read the earlier parts of the book. The crucial thing you’re missing is that $X$ must be compact (and $Z$ closed). Indeed, in your example, you can push the $x$-axis up and have no intersections at all.