Robot gait optimization is the task of generating an optimal control trajectory under various internal and external constraints. Given the high dimensions of control space, this problem is particularly challenging for multi-legged robots walking in complex and unknown environments. Existing literatures often regard the gait generation as an optimization problem and solve the gait optimization from scratch for robots walking in a specific environment. However, such approaches do not consider the use of pre-acquired knowledge which can be useful in improving the quality and speed of motion generation in complex environments. To address the issue, this paper proposes a transfer learning-based evolutionary framework for multi-objective gait optimization, named Tr-GO. The idea is to initialize a high-quality population by using the technique of transfer learning, so any kind of population-based optimization algorithms can be seamlessly integrated into this framework. The advantage is that the generated gait can not only dynamically adapt to different environments and tasks, but also simultaneously satisfy multiple design specifications (e.g., speed, stability). The experimental results show the effectiveness of the proposed framework for the gait optimization problem based on three multi-objective evolutionary algorithms: NSGA-II, RM-MEDA and MOPSO. When transferring the pre-acquired knowledge from the plain terrain to various inclined and rugged ones, the proposed Tr-GO framework accelerates the evolution process by a minimum of 3-4 times compared with non-transferred scenarios.