Former Beach teacher pleads guilty to having sexual relationship with student