The code is in wp-includes/general-template.php.
However there aren’t any great options for styling the output: there’s a hook for you to modify the link URL, but nothing else. Your best bet might be to call it in type=array mode
$links = pagination_links([ "type" => "array" ]);
which will return you an array of strings of links of the form
<a class="prev page-numbers" href="https://wordpress.stackexchange.com/page/1/">« Previous</a>
<a class="page-numbers" href="https://wordpress.stackexchange.com/page/1/">1</a>
<span aria-current="page" class="page-numbers current">2</span>
<a class="page-numbers" href="http://wordpress.stackexchange.com/page/3/">3</a>
<a class="next page-numbers" href="http://wordpress.stackexchange.com/page/3/">Next »</a>
which you can then process into Bootstrap form:
- replace “page-numbers” in the class with “page-link”
- convert the current page span into a regular link with class=”active” too
- wrap each item with in
<li class="page-item">...</li>
- and then wrap the whole thing in
<ul class="pagination>..</ul>
.
However it may be simpler to just copy/paste the function into your own code and change the mark-up it generates, rather than trying to unpack and rewrite mark-up after the fact. You potentially lose any future core updates to the function, but I think those are unlikely beyond occasional aria changes.