Constructing Solutions for the Generalized Hénon–Heiles System Through the Painlevé Test