During beam time at a research facility, alignment and optimization of instrumentation, such as spectrometers, is a time-intensive task and often needs to be performed multiple times throughout the operation of an experiment. Despite the motorization of individual components, automated alignment solutions are not always available. In this study, a novel approach that combines optimisers with neural network surrogate models to significantly reduce the alignment overhead for a mobile soft X-ray spectrometer is proposed. Neural networks were trained exclusively using simulated ray-tracing data, and the disparity between experiment and simulation was obtained through parameter optimization. Real-time validation of this process was performed using experimental data collected at the beamline. The results demonstrate the ability to reduce alignment time from one hour to approximately five minutes. This method can also be generalized beyond spectrometers, for example, towards the alignment of optical elements at beamlines, making it applicable to a broad spectrum of research facilities.