Disclaimer: I am not a novel writer, but I am a screenplay writer and I think the same principles apply.
The key to sequels is thinking about the question What is my character's ambition in life? If the character's ambition in life has not been resolved, then there is still more story to tell.
The ambition of a main character is different than a regular goal. The main thing that distinguishes just any old goal and an ambition is the longevity of the goal. An ambition is something that the character has wanted long before the events of the story.
If you believe me, you can stop reading here, but if you don't, I will give a few examples to convince you of this.
To address the example in your description, look at the Harry Potter Series. Harry's ambition is to find closure with his parent's death. This simple ambition was used as the fuel for 7 books. So there is really no end to how many sequels you can create as long as you have not resolved the character's main ambition.
In Toy Story, Woody's ambition is to protect Andy. As long as Andy needs protecting, we have more story to tell. The Toy Story trilogy ends with Andy going off to college, when Andy doesn't need protecting anymore.
In Star Wars, Luke's ambition is to find and connect with his father. This isn't resolved until the very end of the 3rd star wars movie.
As a bad example (of course this is subjective), look at the Matrix Trilogy. The first movie was great, but the second and third movies, while interesting, did not form a cohesive whole with the original. Neo's ambition in the first movie was to become free from the "system". I would argue that since this was resolved at the end of the first movie, there was nothing left to say about that story, and the trilogy fell apart.
Notice with The Matrix example that the plot of the film was not resolved in the first movie, and actually carried through all the way to the third film. But the ambition of the main character was. So its important to realize that the plot goal is often different than the main characters main goal in life, and that the plot's goal is not enough to carry a sequel. In a good series, the plot goal aligns with the main character's main goal, in that achieving the plot goal also achieves the character's ambition in life.
Edit I wanted to add that if you really like your world and your characters, but your main character's ambition was resolved, there are ways to still make a good sequel. The best way to do this is to use a different main character that lives in the same world. By lives in the same world, I mean that they either affected or were affected by the events of the first story.
You can use a main character that has the same, or similar, ambition as the first main character (this is what they are doing with the new star wars trilogy), or a main character that has the same, or similar, ambition to a non-main character (like in Blade Runner 2049) or even just using a character that was in the first story but had an ambition that wasn't expounded upon in the first story at all (Better Call Saul).