Aldehydes and ketones react with semicarbazide (\( \text{NH}_2\text{NHCONH}_2 \)) in a weakly acidic medium to form crystalline semicarbazone derivatives. Which of the three nitrogen atoms in a semicarbazide molecule acts as the primary nucleophilic center during this reaction?