Run them in your bash prompt as commands to set them for the rest of the session. They might work in the .env not sure.
You can also just prefix every docker compose command with them like so DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose ...