I think both are fine and the same (but my only experience is via Rust so I don't know if there a prevailing terminology is outside of contexts like this forum).
It's two different approaches to the set theory. By my understanding, it's probably marginally more correct to say that you're "(in)variant over" a generic type(set), and "(in)variant in" a polymorphic type(set), but the two can essentially be used interchangeably and trying to assign differing meanings to the two phrases is misguided at best.
Why? If the type variable is a single type within a set, you're "variant over" the single type, allowing it to be different types from the set. If the type is a set, you're "variant in" that typeset, accepting members from that set. It's a matter of perspective. The same way covariance/contravariance or universal/existential are duals across the function boundary.
IEnumerable<Cat> is a subtype of IEnumerable<Animal>. The subtyping is preserved because IEnumerable<T> is covariant on T.
Action<Animal> is a subtype of Action<Cat>. The subtyping is reversed because Action<T> is contravariant on T.
Neither IList nor IList<Animal> is a subtype of the other, because IList<T> is invariant on T.
I also see a lot of “**variant in the first parameter” and other instances of “**variant in the …” where the “in” is followed by “the” and an indirect description, not directly the “name”[1] of an argument itself. It even once does “the type (A -> (B -> C)) is covariant in the position of A” notably saying “in the position of A” instead of “in A”. My takeaway is that this Wikipeida article, too, has) feature a very divers collection of ways of saying the same thing.
The closest mathematical English expression would probably be "invariant with respect toT", variously abbreviated as "invariant w.r.t. T", "invariant w/r/t T", "invariant wrt T", or "invariant WRT T".
Personally, I just use "over" and "in" interchangeably, leaning toward "over" since that's what the Rust Reference uses.
I was just thinking to myself that "in/co/contravariant with respect to (w.r.t.) some set" works, is the same across all 3, and that makes it easier to remember.
Apparently the same is true in German