Dark Sonic appears in the third season of Sonic X.
That stretch of the series, sometimes referred to as the Metarex saga, took the show in a more serialized direction and introduced several alternate forms of the cast. Dark Sonic is one of them, appearing as a shadowy, black-clad version of Sonic whose look and manner are deliberately unsettling.
If you are going back to watch it, the third season is where the plot threads from earlier episodes pay off, so it helps to have seen the first two. The transformation sequences are also easier to appreciate in order rather than as clips pulled out of context.