Can you take a close up of the disk and bracket on the end of the yellow wires? Looks like a bimetallic thermostatic switch.(should have a temp rating on it) If that’s the case and it’s attached to a sheet metal bracket it likely doesnt matter much where it’s mounted inside the motor housing as long as it’s held securely and out of the way of any moving parts. The motor will likely be fairly uniformly warm when the switch trips and it should happen long before the motor is at risk. (What temp rating are on the wires? -90c,105c? Switch would likely be under that.)