From the game side, you can use AK::SoundEngine::StartOutputCapture(). The capture is on the same audio stream that is sent to the audio device, and as such any processing done in the audio device will not be present.
From an effect plug-in, the received audio buffer is the audio stream at the point of the audio pipeline where the effect is inserted. In such a custom plug-in, you can grab the audio buffer and write it to a file as you please.
Note that if there are audio objects in the audio pipeline, there will be an instance of the plug-in per object stream. To avoid this, you will need to create an object processor effect plug-in.