On solving generalized Nash equilibrium problems via optimization