How does heat shock transformation work?
Heat shock transformation alters membrane fluidity creating pores:


  A sudden increase in temperature creates pores in the plasma membrane of the bacteria and allows for plasmid DNA to enter the bacterial cell.


Reference: Journal of Visualized Experiments. Bacterial Transformation: The Heat Shock Method. 2014. http://www.jove.com/science-education/5059/bacterial-transformation-the-heat-shock-method


  The change in temperature alters the fluidity of the semi-crystalline membrane state achieved at 0oC thus allowing the DNA molecule to enter the cell through the zone of adhesion.


Reference: Anh-Hue T. Tu. Transformation of Escherichia coli Made Competent by Calcium Chloride Protocol. 2008-2013. American Society for Microbiology


  ... heat-pulse (0 degrees C42 degrees C) step of the standard transformation procedure had lowered considerably outer membrane fluidity of cells. The decrease in fluidity was caused by release of lipids from cell surface to extra-cellular medium. A subsequent cold-shock (42 degrees C0 degrees C) to the cells raised the fluidity further to its original value and this was caused by release of membrane proteins to extra-cellular medium.


Reference: Panja S, Aich P, Jana B, Basu T. How does plasmid DNA penetrate cell membranes in artificial transformation process of Escherichia coli? Mol. Membr. Biol. 2008 Aug;25(5):411-22. doi: 10.1080/09687680802187765. PubMed PMID: 18651316.