As you indicate, there are two ways to connect them: 1) in series (i.e. the cold supply foes into the first heater and its hout outlet goes to the cold inlet of the second heater and you run that heater’s outlet to your hot water fixtures), or, 2) in parallel (i.e., you tee the cold water supply into the inlets of both heaters and tee their outlets together to the hot water pipe that supplies your fixtures). It is common to use series heaters with the first yamk’s water being heated by alternate energy sources, mainly solar. In the parallel setup you need to balance the inlet and outlet tees so the heaters heat more or less the same.