You will have to go to a university and obtain a PhD in Bsc Mathematics or the programme you want to teach. And apply to the school.
to increase your odds, you will have to do well and apply as Teaching assistant after first degree with a class of not less than Second Upper. And that is difficult in the Mathematics department. But you can do it with determination.