This is a good way to understand, for example, transfinite ordinals [where we have distinct omega, omega^2, and omega^3, in precisely this manner], as well as many other accounts of differing infinities. But it’s not a great way to understand infinite cardinals (which seems to be what the OP’s after), because typically, x, x^2, and x^3 are all equal for an infinite cardinal x.
[For example, if we imagine your lines as broken up into natural number coordinates, then you are creating 1-, 2-, and 3-dimensional grids whose points are specified by a single natural number, an ordered pair of natural numbers, and an ordered triple of natural numbers, respectively. But these all have the same cardinality; you can put pairs of natural numbers in a countably infinite sequence like so: (0, 0), (1, 0), (0, 1), (2, 0), (1, 1), (0, 2), (3, 0), (2, 1), … . This shows N * N has the same cardinality as N. Then multiplying both by N, we find that N * N * N also has the same cardinality as N * N.
If your lines were thought of as having points indexed by a full continuum, rather than just N, it’s not quite as obvious that they all have the same cardinality, and indeed, but they do, classically. Take the continuum to be indexed by real numbers R, show that R has the same cardinality as 2^N (by showing |R| <= |2^N| and |2^N| <= |R| and then applying the classical Cantor-Schroeder-Bernstein argument), and then observe that 2^N * 2^N = 2^(N + N) = 2^N (using the fact that N + N has the same cardinality as N, as shown by, for example, splitting the naturals into evens and odds, each with the same cardinality as the full naturals).
This argument can break down in non-classical formulations of mathematics (e.g., in the context of intuitionistic logic) where R is not identified with 2^N. Indeed, there’s no continuous correspondence between R and R^2, so any mathematical framework in which all functions of the relevant sort being continuous will consider R and R^2 different sorts of infinities. (Which is a perfectly ok and very ordinary thing to do! It’s just a different thing to look at than other things you might do instead…)].