look in the back side on your engine (toward the #6 cylinder) and you will see sticker/vin stating the engine type. other than that, it is really hard to tell the difference between the M52TU/M54 engine apart (when just comparing the engine w/o any accessories).
you can tell the 330 from the 325 by removing the intake manifold and looking at the shape of the ports. One is a D shape and the other is just oval. another method is remove the valve cover and look at the camshafts. look for the P/N on the camshaft. the P/N on the camshaft is how I verified that I actually bought a M54B30 ZHP engine and not some regular 330 or even a 325 engine.
I hope this helps