Doncaster have signed former Brentford midfielder Harry Forrester on a three-year deal ahead of the Championship season.