In a large skillet over medium high heat, add olive oil, onions, garlic, salt and pepper.
Cook, stirring frequently, for about 10 minutes.
Place the onion mixture, ham hocks, beans, water or stock, and remaining seasonings in a 6-quart slow cooker. Cook on low for 8 hours. About two hours before the cooking time is completed, remove the ham hocks from the slow cooker and let them cool until they can be handled. Remove and discard the bones, fat and skin from the ham hocks. Chop or shred the meat and return it to the slow cooker, cook until the beans are completely tender.
Serve with thick slices of thick buttered sourdough bread.