TeleRAG: Optimizing Retrieval for Retrieval-Augmented Generation