(Skip to the end if you want just the answer and not a story about my personal experience)
While I don't have experience on the receiving end of this, as i still go by my deadname in person, I have some experience accidentally calling people by their deadname (when I was younger). I was in the same kind of position as the person you are talking about, where I had known the person by their deadname for a while, and this was also a time where I knew basically nothing about the LGBTQ+ community. I was finding it hard to remember to not call them by their deadname, but when they confronted me directly about it, I started to get better at remembering.
Basically what I'm saying is you should try talking to them directly, and politely try to get them to understand that this is important to you, and maybe that will help them remember in the future.