The root module can have outputs just like any other module. These outputs can be accessed from other stacks from the backend.
And if you use CDKTF the references are handled transparently.