This battle-tested playbook guided Flex's CEO when she entered a new industry | Fortune