Multipartite entanglement and quantum phase transitions in the one-, two-, and three-dimensional transverse-field Ising model