An endo is done by applying the front brake and leaning the rider forward. Under default controls on standard physics, this would mean lean forward by holding upwards and holding down the brake (L). The bike should lift it's back wheel off the floor.
The easiest way to accumulate 2 mins would be to do it during multiplayer such as when going for the online trophies. As soon as you come to a straight, get some speed, lean your rider forward and hold the front brake down for as long as you can. Then just repeat. Trophy won't pop until the race is complete however after you have accumulated 2 mins.
2 mins can be done over multiple races, it's not just in 1 race.