How would you optimize a slow-running Pandas transformation script that is running out of memory on a large dataset?