My sense is that the Nazis and their talk of a "Third Reich" is the main source for seeing the German Empire as the "Second Reich," but I don't know how the German Empire conceived itself. The Holy Roman Empire only ended in 1806, in living memory when the new Empire began. How did contemporaries understand their connection?
The German Empire drew its legitimacy from German nationalism, not from any links to the Roman Empire (or at least, not any more than every Western country draws on the cultural heritage of Rome). It's important to remember that, in German, "Kaiser" is just the word for "Emperor". The English word can be traced back to Rome, too, from the title "Imperator", originally a military commander that eventually was associated with the emperors.
You should also know that the "Second Reich" wasn't actually called the Second Reich by its contempories. The Nazis invented the term as an attempt to link them and their Third Reich with prior German Empires, but patriotic Germans at the time of unification saw the HRE as an institution that had retarded German development. They saw it as a weak, feudal structure that had empowered petty lords at the expense of the German people. Most grievously (for them), it was responsible for the suffering, weakness and disunity of Germany during the early modern period, most especially during the Napoleonic Wars and the 30 Years War. As such, the German Empire didn't spend much time harking back to the HRE, but instead portrayed itself as a modern nation state that would lead Germany into her rightful place as a great power.