Stabilized finite element methods for convection-dominated problems require the choice of appropriate stabilization parameters. From numerical analysis, often only their asymptotic values are known. This paper presents a general framework for optimizing the stabilization parameters with respect to the minimization of a target functional. Exemplarily, this framework is applied to the SUPG finite element method and the minimization of a residual-based error estimator and error indicator. Benefits of the basic approach are shown and further improvements are discussed