How to contact another PI as a PhD student wishing to discuss their research?
Essentially, the best way to ask is to phrase things exactly as you have.

“Dear Professor $Name,

My name is Anon, and I’m an Nth year PhD student studying at University of Science. I’ll be in Wakanda for a conference from Date1 to Date2, and I was hoping to use the opportunity to meet with some local researchers whose work I have been following.

I was wondering if you might have time during that period to sit down for a chat about research, or perhaps have me visit your lab? I understand schedules can often be quite busy, so I’m happy to be as flexible as possible given the conference schedule.

Regards,
Anon”