uv seams for prcedural meshes in c++

I have c++ class that generates vertices and triangles of a cube sphere and assigns them to a procedural generated mesh. My cube shpere is seamless, by which I mean that vertices at the edges and corners are shared between faces. Unfortunately, I got stuck when trying to generate the UV-coordinates. My idea was to generate a cube map. However I could not figure out how to set up the seams in the UV-domain and there seems little to no information on this topic out there.
Is there a solution to my problem without having to duplicate vertices (which ould be a shame, since it took me quite a while to figure out how to avoid the duplication)?

A similar problem arises btw. when I try to map the sphere according to a lat-lon scheme. That should not be too difficult as rotating the sphere to align one of the diagonals with the z-axis gives me a clean polygon seam between the poles. But again I could not figure out how to implement that seem in uv-space.

Just as a bit of context:
I am just getting started in Unreal Engine 5. I am trying to build up some basic skills mostly by using tutorials as a starting point. My latest little exercise is to procedural generate celestial asteroids. My Idea was to start with a cube sphere procedural mesh, deform it and then generate a texture and normal map based on open simplex noise functions.

Edit:
Ok, I had the wrong idea about what cube maps are used for. What I meant was a uv map that unwraps the cube into it’s face eg. like this:
| X |-X | Y | Y | Z |-Z |