Just tell them what you said in your question.
"Approach, N23456 I will be off frequency for a couple of minutes to pick up the ATIS for ABC Airport."
That should work just fine. If the controller has an issue with that he/she will let you know and respond accordingly depending on existing circumstances.
Remember to report back on frequency.