I have not done this on an e46 yet. But on my e30 it was located near the top of the transmission housing and had 2 wires running into it. It was pretty straight forward. good luck.
"It's not because I'm an aggressive driver, it's because I'm an idiot" actual quote from my wife.