The 23-year-old, who joined Aldershot Town from Watford in June 2016, made 64 appearances for The Shots and scored 17 goals.
Mensah has impressed the season as the Shots aim for promotion back to the Football League.
Chief Executive Laura Smith said: "Bernard was keen to play at a higher level and Gary Waddock didn't want to stand in his way, especially as he would be out of contract in May.
"We only received Rovers' offer this week and wanted a swift resolution."
Mensah took to twitter to post a message thanking manager Gary Waddock, his staff, team-mates and the supporters.
“It was a tough decision to leave but it was an opportunity I couldn’t turn down,” said Mensah.
“I really hope the club get promoted - everything is there for it to happen. The club have the best bunch of lads I have ever shared a changing room with.
“The fans have welcomed me since day one. Thank you.”
.