Extracting boundary facet connectivity and facet node coordinates from mesh

See for instance: How to extract the facet co-ordinates at the free end of a cantilever beam - #3 by dokken
as the question seems very similar.

If that post doesn’t answer your question feel free to elaborate here.