Bus routes in OpenStreetMap are mapped with relations.
Historically OSRM has not supported route relations, and so bus routing has not been possible unless you were prepared to pre-process the .osm.pbf source file somehow.
Happily, support for route relations has just been added to OSRM. So as of the upcoming 5.13 release, or right now if you use
master from github, you can write a custom profile to only use those ways which are part of bus routes. This will take a fair amount of Lua scripting to write the profile, but it is doable at least.
Note that OSM doesn't contain timetable information, so any route you can generate will be theoretical at best: there's no guarantee a bus will be running along the route at the time the user wants to take it, nor that the route generated will be the most efficient when timetables are taken into account. You may wish to look into Graphhopper or OpenTripPlanner as alternatives.