I don't think it's possible to check when the Tor Browser (Firefox) has established a connection with an Entry Relay. What you can do however is load a page and wait until a certain condition is met. If the page loaded, you know you are connected. This functionality is called "Explicit Wait" in Selenium.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver.get("https://check.torproject.org")
try:
element = WebDriverWait(driver, 500).until(
EC.presence_of_element_located((By.ID, "element-id"))
)
finally:
driver.quit()