Example 9 Find all integer pairs $(x, y)$ that satisfy $\left(x^{2}+y^{2}\right)(x+y-3)=2 x y$.

The equation to solve is $\left(x^{2}+y^{2}\right)(x+y-3)=2 x y$.
Analysis: $\because x^{2}+y^{2} \geqslant 2|x y|$, the equality holds when $x= \pm y$, and at the same time, $x+y-3$ is an integer,
$\therefore$ for the original equation to hold, there should be the following four cases:
$$\left\{\begin{array} { l } 
{ x = y , } \\
{ x + y - 3 = 1 ; } \\
{ x y = 0 , } \\
{ x + y - 3 = 0 ; }
\end{array} \quad \left\{\begin{array}{l}
x=-y, \\
x+y-3=-1 ; \\
x=0, \\
y=0 .
\end{array}\right.\right.$$

Therefore, there are four sets of solutions: $(2,2),(0,3),(3,0),(0,0)$.