Watford have signed Lewis McGugan on a three-year contract following his departure from Nottingham Forest.