I used the site REALOEM.COM to put down a rough estimate of what your vehicle might have in it. If you look at the diagram below you can see the number 4 option being the locations for the speed sensors on the automatic transmission. I've learned that it's best to replace sensors in pairs. If you have the Automatic transmission these seem like they would be relatively easy to get to. These are the two speed sensors for the transmission. If you want to go to the site and look for your specific vehicle it could help out. Or if you want to punch in your VIN number on the site it could give a good baseline for figuring out what we are working with.
BAVAuto has the transmission speed sensors for both auto and 6 speed SMG manual.
https://www.bavauto.com/
https://www.realoem.com/bmw/enUS/sho...diagId=24_0997
At this point, I would recommend swapping the speed sensors, if your issue persist after the fact I would focus on having the transmission looked at internally. These can be swapped out without any real mechanical experience.