Please can someone explain the purpose of both the transistor and diode in this soft start circuit
The diode is there to discharge C2 through the bulb when the battery is disconnected.
Discharging C2 "resets" the soft start circuit. When C2 is discharged and the battery voltage is applied, the LM317 outputs some voltage at its output (pin 2) this pulls up the voltage at the emitter of the PNP transistor. Since C2 is discharged the PNP's base is still at 0 Volt (I'm assuming the battery's negative connection is ground, unfortunately there is no ground symbol drawn in this schematic).
So there will be some voltage between base and emitter of the PNP which will switch it on. That will limit the voltage at the emitter of the PNP to about 0.7 V.
The LM317 tries to maintain 1.25 V between its pins 1 (ADJ) and 2 (OUT) so the output voltage is now limited to about 0.7 V + 1.25 V = 1.95 V. As long as C2 is not charged.
However, R3 will charge C2 so the voltage across C2 will increase, the output voltage of the LM317 will increase with it. The PNP transistor behaves as a voltage buffer, it buffers (copies, with a 0.7V shift up due to Vbe) the voltage at C2 to the ADJ input (pin 1) of the LM317. The output voltage will then be about: Vout = 1.95 V + V(C2).
The charging of C2 stops when the normal output voltage (set by R1 and R2) is reached then the voltage at pin 1 of the LM317 will no longer increase. Then almost no current will flow through the PNP and C2 will be charged to the same voltage as ADJ pin of the LM317.
When the battery is disconnected C2 needs to be discharged quickly so that the circuit is ready for the next startup. This discharging is done by the diode. Without the diode C2 would have to discharge through R3 and the rest of the circuit. That will take a while since R3 has a high value. Through the diode, discharging is almost "immediate".
At the beginning, C2 is not charged so the base of the transistor is at ground and the transistor is conducting (its resistance R is low). This means that the ratio R2/R that dominates the behavior of the LM317 here is high and the LM317 is almost not conducting. As C2 charges, the transistor is less and less conducting and the ratio R2/R becomes lower and lower, which causes the LM317 to conduct more and more. Finally, the transistor is not conducting and the behaviour of the LM317 is dominated by the ratio R2/R1, that fixes the final output voltage. The diode may be here to protect the LM317 from some reverse current (but I don't see what current), or more probably to discharge C2 after turning off.