Put black-eyed peas into a large container with enough cool water to cover by a few inches; soak 8 hours to overnight.
Put ham hocks into a stockpot with 6 cups water; bring to a boil, reduce heat to low, cover pot, and simmer until meat is falling off bone, about 90 minutes. Remove ham hocks and reserve for another use. Refrigerate the ham stock, 8 hours to overnight.
Drain and rinse black-eyed peas thoroughly; transfer to a slow cooker. Bury one of the cooked ham hocks in the peas; add onion, garlic, red pepper flakes, and sugar.
Skim congealed fat from surface of ham stock; discard. Pour stock into slow cooker. Add enough water to cover the peas by 1 1/2 inches.