With a mechanical transmission, you can leave it in neutral and the prop will turn without damage to the transmission but there will be noise from the turning shaft. I prefer to leave the transmission in reverse to lock the shaft. This way it is quieter and you sail a small fraction faster.
With an hydraulic transmission, the only way to lock the shaft is with a shaft brake.