A transformation to avoid solutions at infinity for polynomial systems