What is this component (probably a shock/vibration sensor)?
It's just a spring in a tube. The spring is anchored at only one end. When shaken, the other end of the spring touches the tube and completes the circuit.

The transistor functions as a simple amplifier so that the full LED current doesn't need to pass through the sensor.