This is a challenging problem which requires forethought.
To begin, since the target function is odd, only use odd functions. Let $k$ be an positive integer:
$$
\int_{-a}^{a} \text{sgn }(x) x^{2k} dx = \int_{-a}^{0} -x^{2k} dx + \int_{0}^{a} x^{2k} dx = 0
$$
The function sgn$(x)$ is plotted below.

Even functions are excluded, cutting the computational load in half. A further reduction is possible. Because of odd symmetry, only compute half of the integrals:
$$
\int_{-a}^{a} \text{sgn }(x) x^{2k-1} dx = \int_{-a}^{0} -x^{2k-1} dx + \int_{0}^{a} x^{2k-1} dx = 2 \int_{0}^{a} x^{2k-1} dx.
$$
The first attempt at approximation is with a sequence of odd monomials through order $d$
$$
\text{sgn }(x) \approx a_{1}x + a_{3} x^{3} + \cdots + a_{d} x^{d} = \sum_{k=1}^{d} a_{2k-1} x^{2k-1}
$$
The least squares solution is defined as
$$
a_{LS} = \left\{
a \in \mathbb{R}^{m} \colon
\int_{-1}^{1} \left(
\text{sgn }(x) -
\sum_{k=1}^{2m-1} a_{2k-1} x^{2k-1}
\right)^{2} dx
\text{ is minimized}
\right\}
$$
The linear system to solve corresponds to the normal equations
$$
%
\left[ \begin{array}{cccc}
\int_{0}^{1} x \cdot x dx & \int_{0}^{1} x \cdot x^{3} dx & \dots &
\int_{0}^{1} x \cdot x^{2m-1} dx\\
%
\int_{0}^{1} x^{3} \cdot x dx & \int_{0}^{1} x^{3} \cdot x^{3} dx & \dots &
\int_{0}^{1} x^{3} \cdot x^{2m-1} dx\\
%
\vdots & \vdots & & \vdots \\
%
\int_{0}^{1} x^{2m-1} \cdot x dx & \int_{0}^{1} x^{2m-1} \cdot x^{3} dx & \dots &
\int_{0}^{1} x^{2m-1} \cdot x^{2m-1} dx\\
%
\end{array} \right]
%
\left[ \begin{array}{c}
a_{1} \\ a_{3} \\ \vdots \\ a_{2m-1}
\end{array} \right]
=
\left[ \begin{array}{c}
\int_{0}^{1} x dx \\
\int_{0}^{1} x^{3} dx \\
\vdots \\
\int_{0}^{1} x^{2m-1} dx
\end{array} \right]
$$
Below are plots showing a sequence of approximations where the number of terms is $d$:

A problem arises because the amplitudes have unbounded growth. The plot sequence displays the logarithm of the absolute value of the amplitudes $a$. The points marked with red dots were negative. Using the monimials, the amplitudes have an invariance in form.

In remedy, switch from the monomial basis to a nearly orthogonal basis like the Legendre polynomials. Abandon orthogonality and use linear independence. Then we will have invariance in value.
