As we have seen in the first episode of Sacred Games, Ganesh Gaitonde is telling his story to Sartaj Singh. But he died in the first episode and he kept on telling his story. So to whom is he telling his story?
In short: He is telling the story directly to us viewers.
You are right to point out that he dies in the first episode telling only partially his story to Sartaj Singh (Saif Ali Khan). But we know that he is Ashwatthama, and the rest of his story that we see is just Director's way of portraying Gaitonde as an immortal character and showing the impact Gaitonde has on the rest of the story and the history of Mumbai (I won't comment on how much of the story is real).
Sartaj: Who did Dilbagh Singh introduce you to? Put the gun down!
Ganesh Gaitonde shoots himself. Following dialogues are his character talking to us (viewers) after he dies.
Gaitonde: It's not over yet, Mr. Sartaj.
Gaitonde: I told you, I am Ashwathama.
Gaitonde: I won't die.
Sacred Games, Episode 1, "Ashwatthama"
Also, Gaitonde's story makes up a large portion of Sacred Games and gives a chance to the viewers to experience the actual drama of it when the present-story simultaneously unwraps findings of investigation agencies about the story Gaitonde is telling from a investigative point-of-view.