Preheat oven to 375°F Grease a 12 x 8-inch baking dish.
Melt butter in a large skillet over medium heat. Add onion and celery; cook until onions are translucent, about 6 minutes, stirring frequently.
Add flour and stir until well blended. Cook 2 minutes, stirring constantly. Gradually add milk, stirring constantly. Add a ladle of milk mixture to beaten egg yolks; stir well. Pour egg mixture into milk mixture in pan. Add salt, cayenne and black pepper; cook, stirring, until thickened, about 5 minutes.
Place crabmeat in a medium bowl. Add sauce and mix gently but thoroughly to blend. Spoon into prepared pan. Sprinkle with Cheddar.
Bake, uncovered, 25 minutes, or until cheese melts and begins to lightly brown.