Preheat oven to 325°F (160°C).
Remove giblets and neck, if present, from chicken. Rinse chicken inside and out; pat dry.
Place onion and garlic in chicken cavity. Squeeze juice from lemon and set aside; add lemon skin to cavity.
Tuck wings under back of chicken; tie legs together with kitchen string. Brush all over with oil; sprinkle with thyme, rosemary, salt and pepper. Place, breast side up, on rack in roasting pan. Roast, uncovered, in oven for 1 1/2 hours.
Baste chicken with pan juices. Roast, basting occasionally, for about 1 1/2 hours longer or until juices run clear when thigh is pierced and meat thermometer inserted in thigh registers 185°F (85°C). Transfer chicken to platter and tent with foil; let stand 10 minutes before carving.
Skim fat from juices in pan. Sprinkle flour over juices; cook over medium-high heat, whisking, for 1 minute. Drizzle in chicken stock and 2 tablespoons (25 mL) reserved lemon juice; cook, whisking, for about 3 minutes or until thickened. Pour into warmed gravy boat.
Cut string holding legs together; discard onion, lemon and garlic. Using poultry or kitchen shears, cut chicken into 2 breast and 2 leg portions. Cut each breast in half diagonally. Cut through each leg at joint to separate into drumsticks and thigh. Serve with gravy.