Extracting thin film structures of energy materials using transformers