https://www.boe.es/boe/dias/1977/01/05/pdfs/A00170-00171.pdf
Read the first two articles of that law; Spain was no longer a dictatorship. The last clause of the law enacts it as supreme law of the land.
It is following that law that the first Congress of the new democracy (with the mandate to write a Constitution) was elected, using the same procedure we keep using today to elect our Congress. In that election, the francoist party of Fraga lost immensely to the centrist and marxist parties.
If the Constitution they wrote didn't pass the popular vote of the referendum, general elections would be repeated and the process would start again.
It never was a choice between accepting the new Constitution or going back to a dictatorship. It's called "Transición" instead of "Revolución" because the francoist regime turned itself into a democracy following its own laws and procedures.
That's a very optimistic view of the situation. In practice, the instability resulting from not completing the process would have had dramatic consequences. Among other things, there was a Cold War on which could have easily started a new civil war.
> the francoist regime turned itself into a democracy following its own laws and procedures.
But exactly because the prime mover was the regime itself, there was always a chance it could go back on its steps. Compromises had to be made to ensure the transition would go through smoothly, as it's always the case.
Given there were no other options, and few people wanted to return to dictatorship, the new constitution was adopted. But that doesn't mean it wasn't a shotgun, Hobson's choice between dreadful and merely bad. Why should people continue to adhere to it?