RPM Surge

My son has a 2004 Impreza WRX. Recently, he’s been having a problem when he gets into a stop and go driving situation. The RPMs will surge and the car temporarily has a drop in power. While driving along at normal highway speeds, everything is fine.

Is the engine misbehaving or is it the transmission? Manual or automatic tranny?