The Role of Legislation and Policies in Ensuring Energy Security and Energy Transition in China and Germany