As the title reads, it seems very confusing what actually kills a Transformer.
Case 1: Jazz is ripped apart by Megatron in Transformers
Case 2: Megatron is killed by the AllSpark in Transformers
Case 3: Megatron is brought back to life by the AllSpark shard and given parts by a Decepticon Transformers 2: Revenge of the Fallen
Case 4: Optimus Prime is killed by Megatron in Transformers 2: Revenge of the Fallen
Case 5: Optimus Prime is brought back to life by Sam Witwicky by fusion of the Matrix of Leadership in Transformers 2: Revenge of the Fallen
Case 6: Optimus Prime rips The Fallen's Spark out in Transformers 2: Revenge of The Fallen
Case 7: Megatron is killed by Optimus Prime in Transformers 3: Dark of the Moon
Case 8: Ironhide is killed by Sentinel Prime in Transformers 3: Dark of the Moon
Case 9: Optimus Prime has a shell lodged in his chest area and remains dormant for years until Cade Yeager dislodges it in Transformers 4: Age of Extinction
Case 10: Ratchet is killed by Lockdown in Transformers 4: Age of Extinction.
Case 11: Megatron is infused into a new Transformer shell by Joshua Joyce as a new Transformer Galvatron in Transformers 4: Age of Extinction
As you can see from the cases above, some remain dead, others are given life by the AllSpark/Matrix of Leadership or are simply rebuilt.
So the question stands, do Transformers actually die, given that some Transformers remain dead and others are brought back to life?