Lower profile tires tend to tramline more, if you really want to reduce the tramlining get rid of the 17" wheels and go to 16" (or 15" if they will fit the 540i brakes). Shoot for a 50 series tire too.
245/40 is a little too low, 245/45 is a better match to the original diameter. 225/45 will be horrible, don't even bother with those. If you must keep the 17" wheel a 225/50 is a better choice. The 225/45-17 is going to be almost 3/4 inch smaller in diameter and will have even less sidewall. A 225/50-17 is only about 1/3 of an inch smaller.
A 225/55-16 will be almost the same diameter as the stock size (at least what the stock size on a 535i is) and will tramline a lot less than those other sizes.