this is done in the curve configuration (curveconfig.xml), for example
<SwaptionVolatility> ... <ShortSwapIndexBase>EUR-CMS-1Y</ShortSwapIndexBase> <SwapIndexBase>EUR-CMS-30Y</SwapIndexBase> ...
means that swaptions with underlying tenor 1Y or shorter are using the Ibor Index defined in the EUR-CMS-1Y convention, while longer underlyings use the Ibor Index from EUR-CMS-30Y. The CMS conventions are defined in the conventions file (conventions.xml), where you typically will find
<SwapIndex> <Id>EUR-CMS-1Y</Id> <Conventions>EUR-3M-SWAP-CONVENTIONS</Conventions> </SwapIndex> ... <SwapIndex> <Id>EUR-CMS-30Y</Id> <Conventions>EUR-6M-SWAP-CONVENTIONS</Conventions> </SwapIndex> ...
so the volatilities in your swaption surface / cube are assumed to belong to swaptions against Euribor 3M if the underlying is 1Y and otherwise against Euribor 6M.
Notice that the underlying tenor is currently not encoded in the market data label, nor is it possible to have more than one swaption volatility surface per currency (e.g. a tenor dependent one) at the same time in the T0 market definition for a fixed configuration, although extending the system in this direction would surely make sense.