$$
\newcommand{\bx} {\mathbf x}
\newcommand{\by} {\mathbf y}
\newcommand{\bz} {\mathbf z}
\newcommand{\bw} {\mathbf w}
\newcommand{\bu} {\mathbf u}
\newcommand{\bv} {\mathbf v}
$$
Let $\bx$ denote the column vector with entries $x_1, \ldots, x_n$, and similarly for $\by$, where these are the coordinates of the irregular polygon. Let $\bz$ and $\bw$ denote column vectors filled with the $x$ and $y$ coordinates of the regular polygon.
Now let
$$
\bu = \frac{1}{s} \left(\bx - \frac{\bx \cdot \by}{\by \cdot \by} \by \right);\\
\bv = \frac{1}{t} \left(\by - \frac{\bx \cdot \by}{\bx \cdot \bx} \bx \right),
$$
where
$$
s = (\bx \cdot \bx) - \frac{(\bx \cdot \by)^2}{\by \cdot \by}\\
t = (\by \cdot \by) - \frac{(\bx \cdot \by)^2}{\bx \cdot \bx}.
$$
Note, through direct computation, that $\bu\cdot \bx = 1; \bu \cdot \by = 0; \bv \cdot \bx = 0; \bv \cdot \by = 1$.
Let $M$ be the $2 \times n$ matrix with rows $\bu$ and $\bv$. And let $K$ be the $n \times 2$ matrix with columns $\bz, \bw$. Then
$$
KM
$$
takes the vector $\bx$ to the vector $\bz$, and $\by$ to $\bw$. But you wanted it to multiply on the right, with row vectors, so the matrix $T$ you seek is
$$
M^t K^t
$$
Or at least, that's ONE possible matrix that does what you seek.
Note that it's essential that the vectors $\bx$ and $\by$ not be parallel for this approach to work. (Indeed, if they are parallel, there's no solution.)