A CUG is just represented as a set of properties; there's no special API for reading these properties. Just use the JCR or Sling Resource APIs.
That said, what you are describing is both unnecessary and may lead to poor performance (at scale). In JCR, permissions are already inherited, so copying the CUG properties from parent to child isn't necessary.