How to achieve this type of transition?
According to the comments on that page, it is rotoscoped - which is (from Wikipedia)


  the technique of manually creating a matte for an element on a live-action plate so it may be composited over another background.