Is there an inbuilt function to check this or should I extend the contract to do this?
I think there is not such a function, maybe you can watch and collect all events to get all token id that were minted, then analyze.
Found my answer. The functionality is being introduced: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2593