Electromagnetism and hidden vector fields in modified gravity theories: Spontaneous and induced vectorization