First of all, the company you wish to work for or train with must apply for authorisation on your behalf. This is known as an autorización de residencia inicial por traslado intraempresarial in Spanish and the company applies for it at the Spanish Migration Office (Dirección General de Migraciones).
When the authorisation is granted, you may apply for the inter-company transfer visa.