Unlike Linux or Windows, ESXi has no such distinction as UEFI install versus legacy BIOS install. You can freely switch your host back and forth between UEFI and legacy BIOS after installation and ESXi will continue to boot.
Of course it still makes sense to ask whether the current boot used UEFI or legacy BIOS. I don't know offhand of an officially supported way to do that. However, from the ESXi shell you can use the following vsish invocation:
vsish -e get /hardware/firmwareType