Sample complexity of data-driven tuning of model hyperparameters in neural networks with structured parameter-dependent dual function