Uncovering the Formation of Triadic Closure in Social Networks