The supersolid is a counterintuitive state of matter where atoms, arranged in a periodic crystal-like structure, can still flow coherently as they do in a superfluid. The supersolid has been recently observed in trapped quantum gases of strongly dipolar atoms, emerging from the crystallization of a superfluid Bose-Einstein condensate. In this work, we study for the first time the nature of the quantum phase transition associated with the formation of the supersolid both experimentally and theoretically. Although our supersolids are formed by a single row of density clusters arranged in a periodic structure, we observe two different types of transitions that are reminiscent of the first- and second-order phase transitions expected to occur at a thermodynamic level in 2D and 1D, respectively. We find a continuous crossover between the two regimes that can be controlled by changing the atom number and the trap confinement, and we characterize its scaling properties. The two types of phase transitions give rise to supersolids with different structures and dynamical properties.