On the Output Regulation Problem: The Generalized Second-Order Underactuated Linear System Case