Preheat the oven to 350°F (175°C).
Place the chicken breasts on a cutting board and pound them to an even thickness so they cook evenly; season both sides with salt and black pepper.
Heat the olive oil in a large ovenproof skillet over medium-high heat. Add the chicken and sear 4 minutes per side until browned but not cooked through, then transfer the chicken to a plate and tent with foil.
Turn off the heat briefly and zest one lemon into the skillet, then juice that lemon and add the juice to the pan. Add the chicken broth, diced onion, minced garlic, and chopped rosemary. Add slices from the second lemon to the skillet.
Return the skillet to medium-high heat and stir, scraping up any browned bits. Bring to a boil and simmer gently until the liquid reduces to about 1/4 cup, about 8–10 minutes.
Reduce the heat to low and stir in the heavy cream and cubed butter until the butter melts and the sauce is smooth, about 2 minutes.
Add the seared chicken back to the skillet, spoon some sauce over the pieces, then transfer the skillet to the preheated oven and bake uncovered until the chicken is cooked through, about 8–10 minutes.
Remove the skillet from the oven and spoon the lemon-rosemary cream sauce over the chicken before serving with rice if desired.