The album/role relationship is stored in the gs_Role_Album table. Note that only the top-level album is stored; it is inferred that all child albums are automatically included.
The manageroles.ascx page renders the album treeview with the albumtreeview.ascx control. Take a close look at this control to see how albums are rendered. This control is used everywhere in GSP where an album treeview is needed. It is an instance of the Treeview control by ComponentArt.
Hope this helps,
Roger Martin
Creator and Lead Developer of Gallery Server Pro