The transmission is wearing out. Make sure you have the fluid level correct. The trans will not work properly if the fluid level is incorrect.
I don't usually reccomend doing a service on a failing trans because... they end up failing most of the time anyway. That is why you see people reccomending not to flush an old trans. They do not understand that them failure had already occurred, and the flush was a waste of money. You can do a fluid and filter swap though again, unlikely to fix it.
Sounds like a good time to start collecting parts for a manual trans swap
Current ride... '13 GTI Wolfsburg
BMW's from my past...
'92 535i/5 '89 325ix/5
'98 750iL '86 325(e)/5
'95 740iL '84 318i/5