Merger trees can be created for Rockstar-galaxies halo catalogs using consistent-trees. The resulting merger tree data can be loaded with ytree. Note, halo finding must be done on a series of snapshots for this to work (see Halo Finding on Multiple Snapshots).
For halo catalogs created with FoF or HOP, the treefarm package can be used for generating merger trees. For this to work, member particles from halos must also be saved (see Saving Halo Particles). These merger trees can also be loaded with ytree.