Example 3 Solve the equation $\frac{\lg \left(a x^{2}-a^{3}\right)}{\lg (x-a)}=3$ for $x$.

Translate the text above into English, please keep the original text's line breaks and format, and output the translation result directly. 

However, the translation you requested is already in English. Here is the requested content in English, maintaining the original format:

Example 3 Solve the equation $\frac{\lg \left(a x^{2}-a^{3}\right)}{\lg (x-a)}=3$ for $x$.
The original equation is equivalent to
$$
\left\{\begin{array}{l}
a x^{2}-a^{3}>0, \\
x-a>0, \\
\lg (x-a) \neq 0, \\
a x^{2}-a^{3}=(x-a)^{3},
\end{array}\right.
$$

From (4), we solve to get $x=0, x=a$ or $x=3a$. Substituting these into (1), (2), and (3) for verification, we find:
When $a>0, a \neq \frac{1}{2}$, the equation has a solution, which is $x=3a$;
When $a=-1$ or $a=\frac{1}{2}$, the equation has no solution.