generate_packets.py: move get_enum_packet() into PacketsDefinition
Part of #45166. Turn the get_enum_packet() function into a PacketsDefinition.code_enum_packet_type property.
Part of #45166. Turn the get_enum_packet() function into a PacketsDefinition.code_enum_packet_type property.